UNPKG

remeda

Version:

A utility library for JavaScript and Typescript.

27 lines (25 loc) 1.05 kB
/** * A function that takes any arguments and does nothing with them. This is * useful as a placeholder for any function or API that requires a **void** * function (a function that doesn't return a value). This could also be used in * combination with a ternary or other conditional execution to allow disabling * a function call for a specific case. * * Notice that this is a dataLast impl where the function needs to be invoked * to get the "do nothing" function. * * See also: * * `constant` - A function that ignores it's arguments and returns the same value on every invocation. * * `identity` - A function that returns the first argument it receives. * * @signature * R.doNothing(); * @example * myApi({ onSuccess: handleSuccess, onError: R.doNothing() }); * myApi({ onSuccess: isDemoMode ? R.doNothing(): handleSuccess }); * @dataLast * @category Function */ declare function doNothing(): typeof doesNothing; declare function doesNothing<Args extends ReadonlyArray<unknown>>(..._args: Args): void; export { doNothing };