This is an example of how to use RxJS to manage state within a React app.
- The service exposes an emitter that emits the entire state whenever a change is made.
- The React component then calls
setState()
with the new state. - The service is passed down via props so that child components can access mutator methods.