Utils: `functions`
Table of contents
Functions
Functions
isFunction
▸ isFunction(input
): input is Function
Verify an input is a function
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is Function
Defined in
packages/utils/src/functions.ts:64
memoize
▸ memoize<T
>(fn
): T
A replacement for lodash memoize
Type parameters
Name | Type |
---|---|
T | extends MemoizeFn |
Parameters
Name | Type |
---|---|
fn | T |
Returns
T
Defined in
packages/utils/src/functions.ts:48
noop
▸ noop(...args
): any
A simple function that does nothing but return the first argument
Parameters
Name | Type |
---|---|
...args | any [] |
Returns
any
Defined in
packages/utils/src/functions.ts:28
once
▸ once<T
>(fn
): (...args
: ArgType
<T
>) => ReturnType
<T
> | undefined
Creates a function that is only invoked once
Type parameters
Name | Type |
---|---|
T | extends (...args : any []) => any |
Parameters
Name | Type |
---|---|
fn | T |
Returns
fn
▸ (...args
): ReturnType
<T
> | undefined
Parameters
Name | Type |
---|---|
...args | ArgType <T > |
Returns
ReturnType
<T
> | undefined