Concepts Overview
The Arez architecture is based on a strict unidirectional data flow:
- Actions modify observable properties.
- Observable properties notify observers when they change.
- Computable values are values derived from observable properties and other computable values. Computable values notify observers when they change.
- Observers update the user-interface, network communication, etc to reflect the current application state.
Actions may be triggered by observers when they update from application state but it is more likely that a user action, a network message or some other external activity would trigger an action.
A computable value will only be recalculated if it is "active". A computable value is active if it is a dependency of an observer or a dependency of another active computable value. This results in an architecture where changes flow through the application in a manner not unlike in a spreadsheet and observers react to the changes when their dependencies change. Data flows in a directed graph from actions to observers and the observers react to the changes.