March 2018
Intermediate to advanced
364 pages
8h 21m
English
A store at its heart is just a class wrapping a state. A store needs to be able to deal with changes; the change should come via method dispatch. The following pseudo code represents what the store might look like:
// NGRX-light/storeI.jsclass Store { constructor() { this.state = {}; } dispatch() { // calculate the new state and replace the old one }}
We mentioned in the beginning of this main section that NgRx uses RxJS at its core. We mentioned that it was so the store could convey changes to its listeners. Let's mention the core concepts of RxJS that might fit the preceding problem description. In RxJS, we have:
Read now
Unlock full access