@terascope/utils / functions
functions
Functions
isFunction()
isFunction(
input
):input is Function
Verify an input is a function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is Function
Source
packages/utils/src/functions.ts:64
memoize()
memoize<
T
>(fn
):T
A replacement for lodash memoize
Type parameters
Type parameter |
---|
T extends MemoizeFn |
Parameters
Parameter | Type |
---|---|
fn | T |
Returns
T
Source
packages/utils/src/functions.ts:49
noop()
noop(...
args
):any
A simple function that does nothing but return the first argument
Parameters
Parameter | Type |
---|---|
...args | any [] |
Returns
any
Source
packages/utils/src/functions.ts:29
once()
once<
T
>(fn
): (...args
) =>ReturnType
<T
> |undefined
Creates a function that is only invoked once
Type parameters
Type parameter |
---|
T extends (...args ) => any |
Parameters
Parameter | Type |
---|---|
fn | T |
Returns
Function
Parameters
Parameter | Type |
---|---|
...args | ArgType <T > |
Returns
ReturnType
<T
> | undefined