lock() function
@lock() decorator implementation Will make all simultaneous similar method calls locked to be resolved with the first obtained values. Similarity is identified by a bypassed method argument values.
Signature:
export declare function lock(enabledOrOptions?: boolean | LockOptions): (target: any, methodName: string | symbol, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
enabledOrOptions |
boolean | LockOptions |
(Optional) whether to enable locks or not {( target: any, methodName: (string), descriptor: TypedPropertyDescriptor<(...args: any[]) => any> ) => void} |
Returns:
(target: any, methodName: string | symbol, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void