服务器

Array

Collection

Date

Function

Lang

Math

Number

Object

Seq

String

Util

Properties

Methods

    _.after(n, func)

    与_.before的相反; 这个方法创建一个调用func的函数,一旦它被调用n次或更多次。

    初始

    0.1.0

    参数
    1. n (number):调用前func的调用次数。
    2. func (功能):限制功能。
    返回

    (功能):返回新的限制功能。

    var saves = ['profile', 'settings'];
     
    
    var done = _.after(saves.length, function() {
      console.log('done saving!');
    });
     
    _.forEach(saves, function(type) {
      asyncSave({ 'type': type, 'complete': done });
    });
    // => Logs 'done saving!' after the two async saves have completed.
    Try in REPL