Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
tonic + npm: bluebird
node v0.12.18
endpoint
share
tweet
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