js-util

Home > rc-js-util > Once

Once() function

Method decorator. The target will be called only once, subsequent calls will return the first return.

Signature:

export declare function Once<TInstance extends object, TKey extends keyof TInstance>(target: TInstance, key: TKey, descriptor: PropertyDescriptor): void;

Parameters

Parameter Type Description
target TInstance  
key TKey  
descriptor PropertyDescriptor  

Returns:

void