Wprowadzenie do architektury Flux i konceptu Redux’a. Ukazane w praktyce plusy i minusy użycia z ReactJS, AngularJS i Angular 2 z zaprezentowaniem kodu aplikacji.
8. Flux
Dispacher
1. Central hub that manages all
data flow in the application.
2. Distributing the actions to the
stores
9. Flux
1. Contain the application state
and logic
2. Manage the state of many
objects
Store
10. Flux
View
1. Listen for events that are
broadcast by the stores
2. Requests the new data via to
stores’
3. Set received data to its own
state
4. Render view
32. Pros and cons
Pros:
1. Immutable state
2. Store contains whole state from the
application
3. Simply data flow
4. Total separation of data and presentation
5. Dumb components
6. Useful DevTools
Cons:
1. Not needed in all cases
2. Be aware of damages caused
by state mutations