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 the
flatMap()
Observable operator
This CL implements the `flatMap()` Observable operator. See https://wicg.github.io/observable/#dom-observable-flatmap. To accomplish this, we introduce a class hierarchy that looks like: ``` // The delegate that the Observable returned from flatMap() uses to // create subscriptions. class OperatorFlatMapSubscribeDelegate : Observable::SubscribeDelegate { // One of these is created for each subscription created via the // delegate above. For example: // // const mapped = source.flatMap(...); // const a = mapped.subscribe(...); // const b = mapped.subscribe(...); // // A `SourceInternalObserver` gets created for each of `a` and `b`. class SourceInternalObserver : ObservableInternalObserver { // For each value that the source Observable emits, we derive a new // "inner" Observable from it and subscribe to it for the rest of // its lifetime. This class below is the internal Observer for each // of these. class InnerFlatMapObserver : ObservableInternalObserver { }; }; }; ``` For WPTs: Co-authored-by: [email protected] Bug: 40282760 Change-Id: I281ed693908f4b7c3a6d5f1ce8a70f4c5187018b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381640 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Dominic Farolino <[email protected]> Cr-Commit-Position: refs/heads/main@{#1279959}
- Loading branch information
1 parent
787cec1
commit 60af8e8
Showing
8 changed files
with
579 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.