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

feat(operators): add operators operator #2036

Closed
wants to merge 2 commits into from
Closed

feat(operators): add operators operator #2036

wants to merge 2 commits into from

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Oct 14, 2016

This adds an operator call operators that enables users to create a new Observable with
operators added to it as methods based on a passed hash of operator methods.

source.operators({ filter, map })
  .filter(x => x > 1)
  .map(x => x * 10)

related #2034

This adds an operator call `operators` that enables users to create a new Observable with
operators added to it as methods based on a passed hash of operator methods.

```
source.operators(\{ filter, map \})
  .filter(x => x > 1)
  .map(x => x * 10)
```

related #2034
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 97.046% when pulling c5b7773 on blesh:withOperator into 7ee0575 on ReactiveX:master.

@benlesh
Copy link
Member Author

benlesh commented Oct 14, 2016

I'm proposing this because:

  1. I think it solves some of the type inference concerns.
  2. It reads a little cleaner and is more ergonomic.
  3. Use one method, then other operators would work as normal (but I suppose you could change their names if you choose)
  4. It's an alternative

@benlesh
Copy link
Member Author

benlesh commented Oct 14, 2016

NOTE: We can move the method to Observable proper like operate from #2034 as well.

@benlesh
Copy link
Member Author

benlesh commented Oct 14, 2016

... also the name can be bike-shedded, this is more of a proposal.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 97.046% when pulling 3270253 on blesh:withOperator into 7ee0575 on ReactiveX:master.

@staltz
Copy link
Member

staltz commented Oct 15, 2016

Name suggestion: include or including. But still not super happy with the direction this is going.

@benlesh benlesh closed this Dec 16, 2016
@benlesh benlesh deleted the withOperator branch December 16, 2016 03:09
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants