chensenlai 10988628a0 语音房项目初始化 5 jaren geleden
..
test 10988628a0 语音房项目初始化 5 jaren geleden
.npmignore 10988628a0 语音房项目初始化 5 jaren geleden
.travis.yml 10988628a0 语音房项目初始化 5 jaren geleden
LICENCE 10988628a0 语音房项目初始化 5 jaren geleden
README.md 10988628a0 语音房项目初始化 5 jaren geleden
index.js 10988628a0 语音房项目初始化 5 jaren geleden
package.json 10988628a0 语音房项目初始化 5 jaren geleden

README.md

After Build Status

Invoke callback after n calls

Status: production ready

Example

var after = require("after")
    , next = after(3, logItWorks)

next()
next()
next() // it works

function logItWorks() {
    console.log("it works!")
}

Example with error handling

var after = require("after")
    , next = after(3, logError)

next()
next(new Error("oops")) // logs oops
next() // does nothing

function logError(err) {
    console.log(err)
}

After < 0.6.0

Older versions of after had iterators and flows in them.

These have been replaced with seperate modules

Installation

npm install after

Tests

npm test

Blog post

Examples :

Contributors

  • Raynos

MIT Licenced