tonic + npm: bluebird

node v0.12.18
endpointsharetweet
Promise = require("bluebird") function fn1(cb) { cb(); } function fn2(cb) { cb(null); } Promise.fromCallback(function(cb) { fn1(cb); }).then(function(args) {console.log('args1 ' + args)}); Promise.fromCallback(function(cb) { fn2(cb); }).then(function(args) {console.log('args2 ' + args)}); Promise.fromCallback(function(cb) { fn1(cb); }, {multiArgs:true}).then(function(args) {console.log('args3 ', args)}); Promise.fromCallback(function(cb) { fn2(cb); }, {multiArgs:true}).then(function(args) {console.log('args4 ', args)}); null;
Created from: https://tonicdev.com/npm/bluebird
Loading…

no comments

    sign in to comment