Docs
Lint / lint (push) Successful in 18s

This commit is contained in:
Julien Valverdé
2026-06-09 19:00:09 +02:00
parent a74ec6e398
commit 5791c08b51
+6 -6
View File
@@ -9,9 +9,11 @@ title: State Management
scopes. The usual pattern is:
1. Create state with Effect primitives such as `SubscriptionRef`.
2. Expose read-only reactive state as a `Subscribable`.
3. Expose read/write reactive state as a `Lens`.
4. Bind values into components with `Subscribable.useAll`.
2. Turn the Effect primitive into a `Lens` with the matching constructor, such
as `Lens.fromSubscriptionRef`.
3. Expose read-only reactive state as a `Subscribable`.
4. Expose read/write reactive state as a `Lens`.
5. Bind values into components with `Subscribable.useAll`.
`effect-fc` re-exports the `Lens` and `Subscribable` modules from
[`effect-lens`](https://github.com/Thiladev/effect-lens) for convenience. The
@@ -102,9 +104,7 @@ const CounterReadOnlyView = Component.make("CounterReadOnly")(
)
```
Use `Subscribable.useAll` instead of subscribing manually. It reads the current
values during render and uses scoped subscriptions to update React state when
changes arrive.
`Subscribable.useAll` reads the current values during render and uses scoped subscriptions to update React state when changes arrive.
## Lenses