Import
import { delete } from "@typed/fx/RefSubject";This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.
Signatures
export { reset as delete };export declare function reset<A, E, R>(ref: RefSubject<A, E, R>): Effect.Effect<Option.Option<A>, E, R>;Why
Resets a RefSubject to its initial value, returning the previous value if it existed. The
transition is serialized at the RefSubject rather than coordinated by callers or UI components.
Ownership and lifetime
Running reset 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, Option } from "effect"
import * as RefSubject from "@typed/fx/RefSubject"
const program = Effect.gen(function* () {
const count = yield* RefSubject.make(0)
yield* RefSubject.set(count, 5)
const before = yield* count
console.log(before) // 5
// Reset to initial value
const previous = yield* RefSubject.reset(count)
console.log(Option.isSome(previous)) // true
console.log(previous.value) // 5
const after = yield* count
console.log(after) // 0
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.