diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2024-03-16 23:41:38 +0000 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2024-03-17 17:12:10 +0000 |
commit | 4aeb451d32d7ad94a5a4111543584a1430cd4571 (patch) | |
tree | f64480f138db3fca9a4e9bb97e2fcdb883aa4241 /pages | |
parent | 3de8e6e7782b21da3d4efa2e9592634307980d22 (diff) | |
download | lustre-4aeb451d32d7ad94a5a4111543584a1430cd4571.tar.gz lustre-4aeb451d32d7ad94a5a4111543584a1430cd4571.zip |
:recycle: Rename '--include-styles' flag to '--use-lustre-ui' for clarity.
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 |