mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit updates the implementation of the `fetch` patch and additionally patches `Response` methods which return promises. These are `arrayBuffer`, `blob`, `formData`, `json` and `text`. This fixes the issue when zone becomes stable too early before all of the `fetch` tasks complete. Given the following code: ```ts appRef.isStable.subscribe(console.log); fetch(...).then(response => response.json()).then(console.log); ``` The `isStable` observer would log `false, true, false, true`. This was happening because `json()` was returning a native promise (and not a `ZoneAwarePromise`). But calling `then` on the native promise returns a `ZoneAwarePromise` which notifies Angular about the task being scheduled and forces to re-calculate the `isStable` state. Issue: #50327 PR Close #50653 |
||
|---|---|---|
| .. | ||
| browser | ||
| common | ||
| extra | ||
| jasmine | ||
| jest | ||
| mix | ||
| mocha | ||
| node | ||
| rxjs | ||
| testing | ||
| zone-spec | ||
| BUILD.bazel | ||
| zone-global.d.ts | ||
| zone.api.extensions.ts | ||
| zone.configurations.api.ts | ||
| zone.ts | ||