UNPKG

894 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var after = require("lodash/after");
4var factory_1 = require("./factory");
5var applicators_1 = require("./applicators");
6var decorator = factory_1.DecoratorFactory.createInstanceDecorator(new factory_1.DecoratorConfig(after, new applicators_1.PostValueApplicator(), { setter: true }));
7/**
8 * The opposite of Before. This method creates a function that invokes once it's called n or more times.
9 * @param {number} n The number of calls before the function is invoked.
10 * @example
11 *
12 * class MyClass {
13 * @After(2)
14 * fn() {
15 * return 10;
16 * }
17 * }
18 *
19 * const myClass = new MyClass();
20 *
21 * myClass.fn(); // => undefined
22 * myClass.fn(); // => 10
23 */
24function After(n) {
25 return decorator(n);
26}
27exports.After = After;
28exports.after = After;
29exports.default = decorator;
30//# sourceMappingURL=after.js.map
\No newline at end of file