Exercise - Observer
Exercise
The goal of this exercise is to become familiar with using Observables.
- Open exercise on codesandbox.
- I've already imported the
Observable
class for you. - New up the Observable with the subscriber function with a single
Subscriber
parameter. - Create a new interval that delivers a next notification to all observers every 1 second.
- After 10 seconds deliver a complete notification to all observers.
- Be sure to return a teardown function to clear the interval.
- Subscribe to the Observable with an Observer object.