@helux/f-noop
v0.0.1
Published
Function does nothing, this lib supply noop fn or noop fn maker.
Downloads
11
Readme
@helux/f-noop
空函数合集,一共导出了以下空函数或空函数创建函数,可按需使用
export {
makeNoopAny,
makeNoopAnyAsync,
noopAny,
noopAnyAsync,
noopNum,
noopNumAsync,
noopObj,
noopObjAsync,
noopStr,
noopStrAsync,
noopVoid,
noopVoidAsync
};
使用方式
同步的any空函数
import { noopAny } from '@helux/f-noop';
const fn = noopAny;
fn();
异步的any空函数
import { noopAnyAsync } from '@helux/f-noop';
const fn = noopAnyAsync;
fn().then(console.log);
创建自定义返回结果的异步空函数
import { makeNoopAnyAsync } from '@helux/f-noop';
const fn = makeNoopAnyAsync(333);
fn().then(console.log); // print 333