diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/guide/02-state-management.md | 28 | ||||
-rw-r--r-- | pages/reference/cli.md | 4 |
2 files changed, 30 insertions, 2 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: diff --git a/pages/reference/cli.md b/pages/reference/cli.md index 7959959..d02106e 100644 --- a/pages/reference/cli.md +++ b/pages/reference/cli.md @@ -142,7 +142,7 @@ Flags: - `--host` - The host to serve the project on. Defaults to `0.0.0.0` and is accessible on localhosts and any other devices on the same network. -- `--include-styles` - Include the stylesheet from +- `--use-lustre-ui` - Include the stylesheet from [lustre/ui](https://hexdocs.pm/lustre_ui/). This is mainly used in the example projects, but you may use this option to quickly experiment with the library yourself. @@ -150,7 +150,7 @@ Flags: Example: ```sh -gleam run -m lustre dev --port=8080 --include-styles +gleam run -m lustre dev --port=8080 --use-lustre-ui ``` ## Getting help |