Promises, actually futures, in node
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json

README.md

prom, simple node.js promises

Calls functions once a promise has been delivered.

var prom = require('prom');

var onready = prom();
onready(console.log.bind(console, 'one'));
onready(console.log.bind(console, 'two'));

// Deliver the promise
onready.deliver('delivered-arg-1', 'delivered-arg-2').
// > one delivered-arg-1 delivered-arg-2
// > two delivered-arg-1 delivered-arg-2

// Once the promise has been delivered, the callback on next event loop.
onready(console.log.bind(console, 'three'))
// > three delivered-arg-1 delivered-arg-2

License

MIT