Exercise 5: Flux
Some other pieces of Flux
Constants
app/Constants.js
Check (and declare here) ActionTypes that the app understands or uses. So if a store listens to an action type that doesn't exists React can give a warning.
The value of Flux is maintainability and cooperation with other developers. They will (or you, in 6 months time) understand your code.
- data always flows in the same direction
- Constants so people don't misspell actions names
The exercise
Add a button to delete that user.
In Flux Actions are fire & forget. We don't care about the return value. There shouldn't be a return value. Just call a server when it finishes.
- Loading errors (from server)He would send them to the store.