work.suroh.tk/node_modules/traverse-chain/README.md

38 lines
437 B
Markdown
Raw Normal View History

2019-12-02 12:22:45 +00:00
# traverse-chain
A simple asynchronous tool
## Installation
```bash
$ npm install traverse-chain
```
## Example
```javascript
var Chain = require('traverse-chain');
var chain = new Chain();
chain.add(
function() {
setTimeout(function() {
chain.next();
}, 2000);
},
functin() {
setTimeout(function() {
chain.next();
}, 1000);
}
)
chain.traverse(function() {
// done
});
```
## License
MIT