Import
import { RefSubject } from "@typed/fx";Access RefSubject.increment through the imported RefSubject export. Its declaration below describes the member.
This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.
Signatures
export declare function increment<E, R>(ref: RefSubject<number, E, R>): Effect.Effect<number, E, R>;Why
Increments a numeric RefSubject by 1. The transition is serialized at the RefSubject rather
than coordinated by callers or UI components.
Ownership and lifetime
Running increment performs one serialized subject transition and resolves with its committed value. It acquires no resource; failures and services remain those of the source ref.
Examples
import { Effect } from "effect"
import * as RefSubject from "@typed/fx/RefSubject"
const program = Effect.gen(function* () {
const count = yield* RefSubject.make(0)
yield* RefSubject.increment(count)
const value = yield* count
console.log(value) // 1
yield* RefSubject.increment(count)
const newValue = yield* count
console.log(newValue) // 2
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.