junosuarez / pr

node builtins wrapped for promises
11 stars 1 forks source link

Work with any Promise library #2

Open Bartvds opened 10 years ago

Bartvds commented 10 years ago

It would be nice if pr would work with any Promise library instead of using a bundled (outdated) bluebird.

This module prfun had a nice pattern where it either uses a local (polyfilled) ES6 Promise or user-supplied one:

var Promise = prfun(require('bluebird'));

Maybe this is interesting forpr too: this pattern saves a Promise.cast() around every call (it gets very tedious) and instead just use the same library as the rest of the user code.

junosuarez commented 10 years ago

This sounds like a good idea. I would accept a pull request for this.