September 2017
Intermediate to advanced
216 pages
6h 8m
English
The other thing we'll want to pass to the App() function are the side-effect functions. The aim is to pass the side-effect functions that handle one slice of the overall application state. There's little point in having a side-effect function that runs in response to every conceivable state change. In fact, we can map side-effect functions in the same way as we do with the state itself:
App( Map.of( 'home', Map.of(...), 'users', Map.of(...), 'settings', Map.of(...) ), Map.of( 'home', (home) => { ... }, 'users', (users) => { ... }, 'settings', (settings) => { ... } ));
The map with the side-effect functions closely resembles the application state map. This allows us to run certain behavior when a certain part of the state changes. ...
Read now
Unlock full access