Skip to content

Conversation

@plrthink
Copy link

@plrthink plrthink commented Oct 9, 2015

By making callback node style, the first argument of callback is error, users can use something like bluebird.promisify to convert the callback style to the promise style.

@darkrishabh
Copy link
Owner

This is a good change but it might be a breaking change for many.
I am kind of involved with some other stuff these days will merge it soon. untill then you can fix/ make sure it doesn't break the current applications

@kylegoetz
Copy link

It's been two years and this hasn't been merged. For anyone coming to this who only knows how to promisify using Bluebird or another third-party promisify function, here's how you do it with the add function as an example:

function myAdd(item) {
    return new Promise(resolve => db.add(item, result => resolve(result)))
}

myAdd will now return a promise that resolves to what db inserted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants