Skip to content
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(store): change instanceof Promise to isPromise to allow any promisable object #2093

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

arturovt
Copy link
Member

@arturovt arturovt commented Feb 4, 2024

We need to use isPromise instead of checking whether result instanceof Promise.
In zone.js patched environments, global.Promise is the ZoneAwarePromise. Some APIs,
which are likely not patched by zone.js for certain reasons, might not work with instanceof.
For instance, the dynamic import returns a native promise (not a ZoneAwarePromise), causing
this check to be falsy.

…romisable object

We need to use `isPromise` instead of checking whether `result instanceof Promise`.
In zone.js patched environments, `global.Promise` is the `ZoneAwarePromise`. Some APIs,
which are likely not patched by zone.js for certain reasons, might not work with `instanceof`.
For instance, the dynamic import returns a native promise (not a `ZoneAwarePromise`), causing
this check to be falsy.
Copy link

nx-cloud bot commented Feb 4, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1d21f86. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

Copy link

bundlemon bot commented Feb 4, 2024

BundleMon (Integration Projects)

Files updated (1)
Status Path Size Limits
Main bundles(Gzip)
hello-world-ng15/dist-integration/main.(hash)
.js
63.38KB (+34B +0.05%) +1%

Total files change +34B +0.05%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@arturovt
Copy link
Member Author

arturovt commented Feb 5, 2024

Ugh the Circle always randomly failing with a timeout...

@arturovt arturovt merged commit a138dd1 into master Feb 5, 2024
12 of 13 checks passed
@arturovt arturovt deleted the fix/is-promise branch February 5, 2024 20:44
@markwhitfeld markwhitfeld added this to the v.18.0.0 milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants