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

Rename "switch" -> "flatMapLatest" #33

Closed
raimohanska opened this issue Nov 18, 2012 · 4 comments
Closed

Rename "switch" -> "flatMapLatest" #33

raimohanska opened this issue Nov 18, 2012 · 4 comments

Comments

@raimohanska
Copy link
Contributor

Would this be a better name?

This name would clearly link the method to flatMap. Also, it doesn't cause conflict with the switch keyword.

Better suggestions?

@niklasvh
Copy link

Similar to this case, the do function also uses a reserved keyword. Obviously, you can work around it by using ["do"] or ["switch"] notation, but if you are considering changing the switch name, you may want to consider doing the same with the do.

i.e.

$("#b").asEventStream("click")["do"](".preventDefault"); // works fine all
$("#b").asEventStream("click").do(".preventDefault"); // throws an error on < IE9

@mileskin
Copy link
Contributor

Maybe doAction like in RX?

@raimohanska
Copy link
Contributor Author

switch -> flatMapLatest
do -> doAction

ok? I guess we should maintain backward-compatibility, too.

@raimohanska
Copy link
Contributor Author

Renamed, published version 0.0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants