-
Notifications
You must be signed in to change notification settings - Fork 1
Home
A lot of the things seen above belong outside the Redux implementation, and are hence explained here:
An extension of the Android ViewModel API. Composes the actual Redux Store & subscribes to it. The core Redux implementation is agnostic of Android lifecycles (for Activities/Fragments). This is the bridge between the Redux world and the Android view layer. It is also responsible for initializing the Store.
API for subscribing to and receiving updates from the 'Store'. Composes 'ReduxViewModel' to hook up & manage things internally. Should be composed inside your Activity/Fragment.
It's responsibilities include maintaining the middleware chain & handling the flow of actions through it.
Since Android is multi-threaded, we take advantage of it & execute actions on the entire dispatch chain in a background thread. The results are posted back to the main thread, where the Action originated.
Handles maintaining multiple instances of the state. A crass object pool with just two values, which it keeps alternating. Debateably necessary for ensuring that no one holds the state/modifies it.