Exercise - Observables
Exercise
Ok, let's dive into the code ourselves. The goal of this exercise is to become familiar with using Observables.
- Open the exercise on codesandbox.
- I've already imported the
fromEvent
function for you. - Use the
fromEvent()
function to create a new Observable that attaches a click event listener to the document. - Use the
subscribe()
method to invoke the Observable. - Use
console.log()
to log a message when a value is produced.