-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support context #6
Comments
|
I don't see the point when you can use
I find |
Can you elaborate? Might be something that can be done about that ;) |
The problem is that we can't say if the function will ever call the callback that pify attaches to So the only way I see is to filter methods manually. Question is: what is the better way to do this (for consumers)? var pifiedObj = pify.all(obj, {
include: ['some', 'good', 'methods'],
exclude: ['bad', 'ones']
}); What do you think? |
I've looked at the Bluebird promisify code and it tries to infer using magic, but I'd rather it be explicit. Your suggestion looks good. Wanna do a PR? Include and exclude should be mutually exclusive. |
Yes, I'm in, thanks! |
Related to #27? |
As far as I can get, right now the only way to carry the context through pify is to explicitly
.bind()
it:This is all cool and native, but wouldn't it be more clean to make
context
an option:Especially when one wants to save
opts
somewhere and pify several methods of one object?This is more of a question than request, although I could make a PR if it souds like a good idea 😏
The text was updated successfully, but these errors were encountered: