remeda
Version:
A utility library for JavaScript and Typescript.
28 lines • 1.15 kB
text/typescript
//#region src/doNothing.d.ts
/**
* 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;
//#endregion
export { doNothing };
//# sourceMappingURL=doNothing-yt855J2n.d.cts.map