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
fix: change use of instanceof Promise
to use is-promise
library
#1837
Conversation
Thank you for opening this PR but this breaks sync execution because executor can be sync as well. Instead of |
@ardatan okay I can change the implementation to check the object then. |
This is not a fix, but rather a change of behavior. The linked issue you provided suggested replacing instanceof with the is-promise package. Does that work? If so, it should be used across entire package. |
@ardatan yes that's one way. There's a more thorough check. (linked below)
Ah, I didn't realise. Thanks for clarifying
@yaacovCR yes I can confirm that using that package works too. It's a one-line function, which could be added to this packages utils. https://github.com/then/is-promise/blob/1d547300e780a4eca391236f15e5ccbf76a5789d/index.js#L4-L6 I was thinking of just implementing this directly in code. If What would you prefer, use the |
@yaacovCR you're right, there are quite a few instances of |
instanceof Promise
to use is-promise
library
Defer to @ardatan
Fix is probably only necessary for externally generated promises?
…On Tue, Jul 28, 2020, 6:19 AM Chris James ***@***.***> wrote:
@yaacovCR <https://github.com/yaacovCR> you're right, there are quite a
few instances of instanceof Promise in the codebase. Would be best to
refactor all of them in this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1837 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7LAYAAQNQRNXQCKTGI733R52Q2DANCNFSM4PKEI5FA>
.
|
Probably should be consistent to how the guild handles this in their other
libraries
…On Tue, Jul 28, 2020, 8:04 AM Yaacov Rydzinski ***@***.***> wrote:
Defer to @ardatan
Fix is probably only necessary for externally generated promises?
On Tue, Jul 28, 2020, 6:19 AM Chris James ***@***.***>
wrote:
> @yaacovCR <https://github.com/yaacovCR> you're right, there are quite a
> few instances of instanceof Promise in the codebase. Would be best to
> refactor all of them in this.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1837 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AA7LAYAAQNQRNXQCKTGI733R52Q2DANCNFSM4PKEI5FA>
> .
>
|
This reverts commit c59c9c4.
@ardatan @yaacovCR I've updated the PR to change all the uses of |
@cajames I think we can merge it! Could you fix merge conflicts? |
@ardatan sweet! And yep I've fixed the conflicts. |
ffb642b
to
7089fa6
Compare
Defer to @ardatan, but my two cents is to fix in code only and not tests or to inline similar version of function as graphql-js |
Hey guys, |
Thanks @cajames ! |
The latest changes of this PR are available as alpha in npm: Quickly update your package.json by running:
|
Closes #1836
TODO: