Check out a free preview of the full Rx.js Fundamentals course
The "fromEvent Exercise" Lesson is part of the full, Rx.js Fundamentals course featured in this preview video. Here's what you'd learn in this lesson:
Students are instructed to use fromEvent to create an observable that streams click events, subscribe to that observable, and use addMessageToDOM to add a message to the DOM whenever the stream emits a value.
Transcript from the "fromEvent Exercise" Lesson
[00:00:00]
>> We have a little application called fromEvent. At this point, you do want to clone down the repro and do npm start. Because if you just go to the published version and you change code, nothing will happen because that's not your code. So you can spin up the local server, it is at local host one, two, three, and four.
[00:00:20]
And, in this case, what we wanna do is, this is real simple. There's a helper method called addMessageToDOM, we just wanna get a little bit of experience using a fromEvent helper in the same way we did with of and from. And then we're kind of getting all these small pieces, collecting them, understanding them, and we will build to somewhat bigger and better things as time goes on.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops