UNPKG

787 BTypeScriptView Raw
1import { LodashDecorator } from './factory';
2declare const decorator: (...args: any[]) => LodashDecorator;
3/**
4 * Creates a function that invokes func, with the this binding and arguments of the created function, while it's called less than n times.
5 * Subsequent calls to the created function return the result of the last func invocation.
6 * @param {number} n The number of calls at whichc func is no longer invoked.
7 * @example
8 *
9 * let calls = 0;
10 *
11 * class MyClass {
12 * @Before(3)
13 * fn() {
14 * calls++;
15 * }
16 * }
17 *
18 * const myClass = new MyClass();
19 *
20 * myClass.fn();
21 * myClass.fn();
22 * myClass.fn();
23 * myClass.fn();
24 *
25 * calls === 2; // => true
26 */
27export declare function Before(n: number): LodashDecorator;
28export { Before as before };
29export default decorator;