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

Adds example solutions for the observables homework #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codebyuma
Copy link
Collaborator

@codebyuma codebyuma commented Mar 26, 2018

Just a reminder: to view the output for each exercise, open the .html file in your browser and open the browser console.

@@ -17,3 +17,8 @@ const clickStream = Observable.fromEvent(theButton, "click");
No output after the fourth click,
"Dog #5" after the fith click, and so on.
*/

Copy link
Collaborator Author

@codebyuma codebyuma Mar 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: in reality, we may want to filter before we map to avoid doing extra work on the emissions we'll eventually ignore. But since the desired output adds the source stream's emission number to the string, we have to filter after we map.

For example, if we filtered first and then mapped, then the output would be Dog #1, Dog #2, etc. If we map and then filter, the output is Dog #1, Dog #3, etc.

If this doesn't make sense, try switching the order and you can see it in action :)

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

Successfully merging this pull request may close these issues.

1 participant