lodash-decorators
Version:
A collection of decorators using lodash at it's core.
30 lines (29 loc) • 639 B
TypeScript
import { BiTypedDecoratorN } from './factory';
/**
* Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to func when it's invoked.
*
* @param {...*} [args] Additional arguments to invoke the function with
* @example
*
* class MyClass {
* value = 100;
*
* @Defer()
* add(a) {
* this.value += a;
* }
* }
*
* const myClass = new MyClass();
*
* myClass.add(10);
*
* myClass.value; // => 100;
*
* setTimeout(() => {
* myClass.value; // => 110;
* }, 0);
*/
export declare const Defer: BiTypedDecoratorN;
export { Defer as defer };
export default Defer;