0.1.0 • Published 10 years ago

callback_tracker v0.1.0

Weekly downloads
12
License
mit
Repository
github
Last release
10 years ago

Callback Tracker

Sometimes you need to perform multiple operations before resolving an initial callback. This tool is a small and simple way to track all the callbacks.

example:

var tracker = require('callback_tracker');

function getOneThing(thingWanted, done) {
  //...

  // done(result);
}

function getAlotOfThings(thingsWanted, done) {
  var results = [];
  var track = tracker.create('done', function() {
    done(results);
  };

  thingsWanted.foreach(function(thingWanted) {
    getOneThing(thingWanted, track('getting ' + thingWanted, function(result) {
      results.push(result);
    }));
  });
}
0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago