Skip to content

reusePending()

Function

reusePending<Args, Return>(fn: Function): Function

In case a previous invocation is still running, return the result of that invocation when it is done instead of executing the function again.

Source: packages/concurrency-utils/src/lib/reuse-pending.ts:6

Type parameters

Parameter
Args extends unknown[]
Return

Parameters

ParameterType
fn(...params: Args) => Promise<Return>

Returns

Function

(...args: Args): Promise<Return>

Parameters

ParameterType
...argsArgs

Returns

Promise<Return>