Skip to content Skip to sidebar Skip to footer
Showing posts with the label Bluebird

How To Turn Nested Callback Into Promise?

Recently I started using pg-promise with bluebird library. I have always been nesting callback and … Read more How To Turn Nested Callback Into Promise?

How To Wait For The Return Of A Mongoose Search?

I created a CRUD with NodeJS / Mongoose, split the files in MVC style. In route example I show up b… Read more How To Wait For The Return Of A Mongoose Search?

Swap Order Of Arguments To "then" With Bluebird / Nodejs Promises

I have a function which asynchronously grabs a value from a server: var request = require('requ… Read more Swap Order Of Arguments To "then" With Bluebird / Nodejs Promises

Testing Rejected Promise In Mocha/chai

I have a class that rejects a promise: Sync.prototype.doCall = function(verb, method, data) { var… Read more Testing Rejected Promise In Mocha/chai

Catch Error Type In Bluebird Not Working

I have a custom error class: class NetworkError extends Error { constructor() { super('Ne… Read more Catch Error Type In Bluebird Not Working

Sequential Execution Of Promise

I have following promise functions implemented like return new Promise(function(resolve, reject) { … Read more Sequential Execution Of Promise

Typescript Use Dynamic Import In Es5 With Bluebird

I'm trying to use the new dynamic import() function in TypeScript, but I get the following erro… Read more Typescript Use Dynamic Import In Es5 With Bluebird

How To Reuse A Mongo Connection With Promises

How can I change things around in my db connection call so that I can do db.collection(): // Create… Read more How To Reuse A Mongo Connection With Promises

How Do You Call A Function With Parameters In A .then Function In A Javascript Promise String?

I am converting my AWS lambda functions, written in node.js, to use promises instead of callbacks. … Read more How Do You Call A Function With Parameters In A .then Function In A Javascript Promise String?

I Broke My Promise

So.. I'm having the hardest time learning how to Promise. I'm using bluebird (https://githu… Read more I Broke My Promise

Cannot Read Property Of Undefined After Promise.promisify

let nasPath = ''; return getFamInfo(args.familyID) .then(function (famInfo) { n… Read more Cannot Read Property Of Undefined After Promise.promisify

Bluebird Promise Serial Iteration, And Resolve To Modified Array?

I have this promise that creates a new Item document if it's not found in the db, and then stor… Read more Bluebird Promise Serial Iteration, And Resolve To Modified Array?