Comparing with Traditional MVC
Application developed by Redux pattern shared a quite similar architecture to #mvc, so we could start by defining the five redux things with comparison,
- Action is similar to event in most MVC framework that is used as a trigger point for subroutine
- Reducer could be regarded as event handler modifying the model
- Store is commonly taken as global application state, which just likes those models
- State
- Well, please think it as local variable in your controller first
- it should be useless afterward, or just the same as Store
- Component
- Umm, just likes that View in MVC
- Actually, it is something big
#promise will widely adopt for asynchronous actions too. Readers should have these basic concepts ready
- new Promise()
- reject
- resolve
A typical OOP MVC UI framework from Android
A Stateful presentation for Redux
A typical Redux life cycle
Whenever a state change happened, components including containers and presenters are forced to invalidate