chensenlai 10988628a0 语音房项目初始化 | 5 år sedan | |
---|---|---|
.. | ||
test | 5 år sedan | |
.npmignore | 5 år sedan | |
.travis.yml | 5 år sedan | |
LICENCE | 5 år sedan | |
README.md | 5 år sedan | |
index.js | 5 år sedan | |
package.json | 5 år sedan |
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