Import
import { make } from "@typed/fx/RefArray";Signatures
export declare function make<A, E = never, R = never>(initial: ReadonlyArray<A> | Effect.Effect<ReadonlyArray<A>, E, R> | Fx.Fx<ReadonlyArray<A>, E, R>, eq?: Equivalence<A>): Effect.Effect<RefArray<A, E>, never, R | Scope.Scope>;Why
Creates array state with equality suited to that Effect data type, so unchanged values do not produce redundant pushed updates.
Ownership and lifetime
The creation Effect requires Scope. It owns initializer acquisition, live source subscriptions, and cleanup; source failures and services stay on reads and pushes.
Examples
import { Effect } from "effect"
import * as RefArray from "@typed/fx/RefArray"
// From a plain array
const program1 = Effect.gen(function* () {
const items = yield* RefArray.make([1, 2, 3])
const values = yield* items
console.log(values) // [1, 2, 3]
})
// From an Effect
const program2 = Effect.gen(function* () {
const items = yield* RefArray.make(
Effect.succeed(["a", "b", "c"])
)
const values = yield* items
console.log(values) // ["a", "b", "c"]
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.