js-util

Home > rc-js-util > fpOnce

fpOnce() function

Creates a function that can be called many times but will run at most once.

Signature:

export declare function fpOnce<TArgs extends unknown[], TRet>(initialize: (...args: TArgs) => TRet): (...args: TArgs) => TRet;

Parameters

Parameter Type Description
initialize (…args: TArgs) => TRet  

Returns:

(…args: TArgs) => TRet

Remarks

See fpOnce().