-
Notifications
You must be signed in to change notification settings - Fork 361
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
Add switch_map operator and equivalent starred and indexed #634
base: master
Are you sure you want to change the base?
Conversation
eec49cb
to
8a66310
Compare
8a66310
to
0cd0167
Compare
Great work! The main building blocks of Rx is the merge functions ( |
This draws from the definition in rxjs and maintains parity with the map operator and its variants
0cd0167
to
7fbbd9d
Compare
""" | ||
The switch_map operator. | ||
|
||
Project each element of an observable sequence into a new observable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Project each element of an observable sequence into a new observable. | |
Project each element of an observable sequence into a new observable. producing values only from the most | |
recent observable sequence. |
The switch_map_indexed operator. | ||
|
||
Project each element of an observable sequence into a new observable | ||
by incorporating the element's index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by incorporating the element's index. | |
by incorporating the element's index and producing values only from the most recent | |
observable sequence. |
Unpack arguments grouped as tuple elements of an observable sequence | ||
and return an observable sequence whose values are each element of | ||
the observable returned by invoking the mapper function with star | ||
applied on unpacked elements as positional arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied on unpacked elements as positional arguments. | |
applied on unpacked elements as positional arguments, and only producing values only from the most recent | |
observable sequence. |
An operator function that takes an observable source and returns | ||
an observable sequence whose values are each element of the | ||
observable returned by invoking the mapper function with the | ||
unpacked elements of the source. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: " ... producing values only from the most recent observable sequence.""" or else it looks like a flat_map.
@hamstap85 One thing that worries me about this PR is that the tests are derived from |
@dbrattli No worries at all, thanks for the feedback. What's the desired max line length in docstrings? Equal to python code max length enforced by |
Docstrings should follow PEP-8, i.e 72 chars per line. PS: all the current tests for |
This draws from the definition in rxjs and maintains parity with the
map operator and its variants