Refactor Subscribable
Lint / lint (push) Successful in 45s

This commit is contained in:
Julien Valverdé
2026-06-21 03:09:41 +02:00
parent fdb2bbfd00
commit 364536b35a
4 changed files with 53 additions and 34 deletions
+3 -3
View File
@@ -126,12 +126,12 @@ yield* Lens.updateSomeEffect(lens, (value) =>
Effect v4 removed its `Readable` and `Subscribable` modules. This package provides a small compatible abstraction with `get` and `changes` properties:
```ts
import { Subscribable } from "effect-lens-next"
import { Lens, Subscribable } from "effect-lens-next"
const users = Subscribable.fromSubscriptionRef(usersRef)
const users = Lens.fromSubscriptionRef(usersRef)
const count = Subscribable.focusArrayLength(users)
const current = yield* count.get
```
The module includes `make`, `map`, `mapEffect`, `unwrap`, `fromSubscriptionRef`, and the same readonly focus helpers used by Lens.
The module includes `make`, `map`, `mapEffect`, `unwrap`, and the same readonly focus helpers used by Lens. A `SubscriptionRef` can first be converted with `Lens.fromSubscriptionRef`, since every Lens is already a Subscribable.