diff options
Diffstat (limited to 'pages/guide/02-state-management.md')
-rw-r--r-- | pages/guide/02-state-management.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pages/guide/02-state-management.md b/pages/guide/02-state-management.md index e525f5f..2c9b641 100644 --- a/pages/guide/02-state-management.md +++ b/pages/guide/02-state-management.md @@ -18,6 +18,34 @@ The MVU architecture is an example of _unidirectional data flow_: - The UI re-renders based on the new state. +```text + +--------+ + | | + | update | + | | + +--------+ + ^ | + | | + Msg | | Model + | | + | v ++------+ +------------------------+ +| | Model | | +| init |------------------------>| Lustre Runtime | +| | | | ++------+ +------------------------+ + ^ | + | | + Msg | | Model + | | + | v + +--------+ + | | + | view | + | | + +--------+ +``` + This is in contrast to _bidirectional_ approaches to state management, where the UI can modify state directly. For some developers this can be a difficult idea to get used to, but it brings a number of benefits: |