Import
import { increment } from "@typed/fx/RefSubject";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.