多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## after + [link](./after "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L8326 "View in source.") + [npm](https://www.npmjs.com/package/lodash.after "See the npm package.") ``` _.after(n, func) ``` 反向版 `_.before`。 这个方法创建一个新函数,当调用 `N` 次或者多次之后将触发 `func` 方法。 ### 参数 1. n (number) `func` 方法应该在调用多少次后才执行 2. func (Function) 指定的触发方法 ### 返回值 (Function) 返回限定的函数 ### 示例 ``` var saves = ['profile', 'settings']; var done = _.after(saves.length, function() { console.log('done saving!'); }); _.forEach(saves, function(type) { asyncSave({ 'type': type, 'complete': done }); }); // => 2次 `asyncSave`之后,输出 'done saving!'。 ```