@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user