forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOM: Implement
inspect()
Observable operator
This CL implements the Observable#inspect() operator. Inspect gives a way to tap into an Observable's outputs. To inspect(), you can provide the following callbacks: ``` source .inspect({ next: v => {}, error: e => {}, complete: () => {} subscribe: () => {} abort: reason => {} }) ``` These are mostly self-explanatory. The subscribe() callback gets called just before the source Observable gets subscribed to, and the abort() handler gets called whenever the Subscriber's signal gets aborted specifically for consumer-initiated unsubscriptions. That is, the abort handler will not be invoked when the source Observable calls its `Subscriber#{error(), complete()}` methods. It only gets called for consumer-initiated subscriptions. This is accomplished by adding an abort algorithm to the inspect() Subscriber's signal, and removing that algorithm immediately whenever the `SourceInternalObserver#{Error(), Complete()}` methods are invoked, so that the `abort()` handler callback does not get invoked when these methods error()/complete() the associated Subscriber. For WPTs: Co-authored-by: [email protected] [email protected] Bug: 40282760 Change-Id: Ia9dfc1291c62e6e665656c09499243ea9930c28a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5435614 Commit-Queue: Dominic Farolino <[email protected]> Reviewed-by: Mason Freed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291316}
- Loading branch information
1 parent
e17dc44
commit 19a2b8a
Showing
9 changed files
with
752 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.