nau 4825f68edf | 8 years ago | |
---|---|---|
.. | ||
test | 8 years ago | |
.npmignore | 8 years ago | |
.travis.yml | 8 years ago | |
LICENCE | 8 years ago | |
README.md | 8 years ago | |
index.js | 8 years ago | |
package.json | 8 years ago |
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