J
jmls
Guest
what I think you are describing is reactive programming (see github.com/.../platform for an angular 4 version) Core tenets: State is a single immutable data structure Actions describe state changes Pure functions called reducers take the previous state and the next action to compute the new state State accessed with the Store, an observable of state and an observer of actions Basically, coding to events. A component *does not* mutate an object : it sends the existing object to a reducer which creates a new object, and mutates that object according to the reducer function. A new state is then broadcast , and any interested subscriber gets the new state. The idea of the store is to have one and only one single place of truth, which means all the objects are immutable, and the only way to change anything is to recreate everything as a whole.
Continue reading...
Continue reading...