Exercise - New Observable
Exercise
The goal of this exercise is to become familiar with creating a new Observable.
- Open the exercise on codesandbox.
- I've already imported the
Observable
class for you. - New up the
Observable
class. - Provide the
constructor()
function with a callback function that will be invoked by RxJS with aSubsciber
instance. - Use the
next()
method to emit a value to all Observers (subscribers) of the Observable. - Finally, use the
subscribe()
method on the newObservable
instance to subscribe to the next notification. - Log out the value that is emitted.