Understanding NgRx – building our own micro implementation

We have done this experiment once before in Chapter 8Redux. 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 8Redux, 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 changes
  • Any change to the store should go through a reducer
  • We will learn to handle side effects
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.160.131