We have done this experiment once before in Chapter 8, Redux. The point was to gain a deeper understanding of what goes on behind the scenes. The difference between implementing Redux and implementing NgRx is the use of a library for publish/ subscribe, which is the way you choose to convey to a listener that a change has occurred. In our Redux implementation in Chapter 8, Redux, we gave you the choice between implementing the Gang of Four publish-subscribe pattern without the help of a library, or using EventEmitter to achieve the same thing. In NgRx, that component is RxJS. So, let's crack on with the implementation. Before doing so, let's describe what we aim to implement:
- We aim to implement a store that holds a state
- It should be possible to dispatch an action to said store so that its inner state...