Skip to main content

@terascope/core-utils / functions

functions

Functions​

isFunction()​

isFunction(input): input is Function

Defined in: packages/core-utils/src/functions.ts:64

Verify an input is a function

Parameters​

ParameterType
inputunknown

Returns​

input is Function


memoize()​

memoize<T>(fn): T

Defined in: packages/core-utils/src/functions.ts:49

A replacement for lodash memoize

Type Parameters​

Type Parameter
T extends MemoizeFn

Parameters​

ParameterType
fnT

Returns​

T


noop()​

noop(...args): any

Defined in: packages/core-utils/src/functions.ts:29

A simple function that does nothing but return the first argument

Parameters​

ParameterType
...argsany[]

Returns​

any


once()​

once<T>(fn): (...args) => ReturnType<T> | undefined

Defined in: packages/core-utils/src/functions.ts:11

Creates a function that is only invoked once

Type Parameters​

Type Parameter
T extends (...args) => any

Parameters​

ParameterType
fnT

Returns​

(...args) => ReturnType<T> | undefined