ExclusiveStackLocalStorage.run() Method
Runs a function with a given store.
Signature
run<X, A extends any[]>(store: T, f: (...args: A) => X, ...args: A): X;
Remarks
If the store is already set (i.e. if the run calls are nested), it will throw an error with the conflictErrorMessage
as the message.
Parameters
Parameter | Type | Description |
---|---|---|
store | T | the local store |
f | (...args: A) => X | the function to run |
args | A | the arguments to pass to the function |
(Returns) | X | - the return value of the function |