RxDataFlow is another implementation of unidirectional data flow architecture. This library is inspired by ReSwift (which was inspired by Redux).
More information will be added soon:)
- State: A data structure that describes state of application.
- Reducer: A pure function that creates new state on base on action and current state.
- Action: Actions describe state change. Reducer produce state changes according to dispatched action.
-
The
View Controller/View Modelcreates anActionand dispatch it to theFlowController. -
The
FlowControllerswitches to appropriate scheduler and sends theStateandActionto theReducer. -
The
Reducerreceives the currentApp Stateand the dispatchedAction, computes and returns newState. -
The
FlowControllersaves newStateand sends it to the subscribers.
- In case of an error
FlowControllerdoesn't changeStateand sendsErrorto all subscribers instead. - It's possible to setup special
FallbackActionthat will be dispatched in case of an error (see CompositeAction).
- Subscriber receives new
Stateand operate accordingly:View Modelmay transformState,View Controllermay directly bind data to the UI.
FlowController dispatches actions in internal SerialDispatchQueueScheduler (so all operations are asynchronous by default), all incoming actions first get in the queue and dispatches (Reducer get executed with current State and Action instances) one after another. For example if you dispatches three actions and every action requires network request - requests will not get fired simultaneously, but one after another.

- RxSwift >= 5.0.1
- Xcode 10.0
- Swift 5.0
- Using Carthage
github "reloni/RxDataFlow"
SimpleToDo - kind of "real world" app using this architecture, already in app store.
List of similar projects:
