Import
import { last } from "@typed/fx/RefArray";Signatures
export declare const last: <A, E, R>(ref: RefArray<A, E, R>) => RefSubject.Filtered<A, E, R>;Why
Models the possibly absent result of last as Filtered state, so absence stays explicit while later source versions can make a value available.
Ownership and lifetime
The last view retains no independent value. Its Effect read fails with NoSuchElement while absent; the observing Scope owns and finalizes its Fx subscription.
Examples
import { Effect } from "effect"
import * as RefArray from "@typed/fx/RefArray"
const program = Effect.gen(function* () {
const items = yield* RefArray.make([1, 2, 3, 4, 5])
const last = RefArray.last(items)
const value = yield* last
console.log(value) // 5
// If array becomes empty, Filtered will fail
yield* RefArray.set(items, [])
// yield* last would fail with NoSuchElementError
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.