-
Notifications
You must be signed in to change notification settings - Fork 110
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
Broken Promises Flow #19
Comments
IMO, a promise shouldn't be returned when a callback is passed |
The callback function does not return a promise so it will never be resolved in .then() function. |
We shall give the same arguments that we passed to callback , to the |
Before promises, error-first callbacks are the only paradigm to propagate errors thru the async chain. Promises have a declarative approach of error-handling now. It may look weird to resolve a promise with errors as first param |
We will not do that we support both error-first call back and promises right ? , let the behaviour be consistent that
The above points mentioned work well independently. |
[Question] Why would people do both ? Should we encourage that pattern of using both ? imo, don't think that's good pattern; callbacks exists for legacy node code. Maybe we can check some other node api wrappers |
@selvagsz , node throws an error if we do not provide callback (eg. We can use the fix i mentioned for backwards compatibility , we can decide later to not return promise when callback is passed, and do Major version bump. |
I don't see any harm , it covers all kinds of users without much overhead , where as the current implementation is inconsistent. |
@rzpamidi Can we close this? |
@captn3m0 , need to implement the changes required. will close it after that |
Different behaviour has been noted with the promise returned, when a callback is passed to the api function.
eg.
The text was updated successfully, but these errors were encountered: