chensenlai 10988628a0 语音房项目初始化 | 5 jaren geleden | |
---|---|---|
.. | ||
test | 5 jaren geleden | |
.npmignore | 5 jaren geleden | |
.travis.yml | 5 jaren geleden | |
LICENCE | 5 jaren geleden | |
README.md | 5 jaren geleden | |
index.js | 5 jaren geleden | |
package.json | 5 jaren geleden |
Invoke callback after n calls
var after = require("after")
, next = after(3, logItWorks)
next()
next()
next() // it works
function logItWorks() {
console.log("it works!")
}
var after = require("after")
, next = after(3, logError)
next()
next(new Error("oops")) // logs oops
next() // does nothing
function logError(err) {
console.log(err)
}
Older versions of after had iterators and flows in them.
These have been replaced with seperate modules
npm install after
npm test