work.suroh.tk/node_modules/traverse-chain
suroh 410082595a init 11ty commit 2019-12-02 13:22:45 +01:00
..
README.md init 11ty commit 2019-12-02 13:22:45 +01:00
index.js init 11ty commit 2019-12-02 13:22:45 +01:00
package.json init 11ty commit 2019-12-02 13:22:45 +01:00

README.md

traverse-chain

A simple asynchronous tool

Installation

$ npm install traverse-chain

Example


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