ember-cli-ajh
Version:
Command line tool for developing ambitious ember.js apps
76 lines (49 loc) • 1.83 kB
Markdown
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
- [iterators][8]
- [composite][9]
`npm install after`
`npm test`
- [Flow control in node.js][3]
- [Determining the end of asynchronous operations][4]
- [In javascript what are best practices for executing multiple asynchronous functions][5]
- [JavaScript performance long running tasks][6]
- [Synchronous database queries with node.js][7]
- Raynos
[]: https://secure.travis-ci.org/Raynos/after.png
[]: http://travis-ci.org/Raynos/after
[]: http://raynos.org/blog/2/Flow-control-in-node.js
[]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307
[]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031
[]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419
[]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091
[]: http://github.com/Raynos/iterators
[]: http://github.com/Raynos/composite