variable / @typed/svelte/Store

toWritable

Exposes a non-failing RefSubject as a writable Svelte store. Writes are synchronous for Svelte subscribers and applied to the RefSubject in the captured Effect context. Both observation and writes belong to the current Scope. After it closes, set/update are inert.

Package version
1.0.0-beta.13
Category
variable

Import

import { toWritable } from "@typed/svelte/Store";

Signatures

export declare const toWritable: <A, R>(ref: RefSubject.RefSubject<A, never, R>) => Effect.Effect<{
    subscribe: (this: void, run: import("svelte/store").Subscriber<A>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
    set: (value: A) => void;
    update: (f: (value: A) => A) => void;
}, never, import("effect/Scope").Scope | R>;

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source