Skip to content

crelte / std/stores / Readable

Class: Readable<T> ​

A svelte store

Extended by ​

Type Parameters ​

T ​

T

Constructors ​

Constructor ​

ts
new Readable<T>(inner): Readable<T>;

Creates a new Readable

Parameters ​

inner ​

Readable<T>

Returns ​

Readable<T>

Methods ​

get() ​

ts
get(): T;

Get the current value

Returns ​

T


subscribe() ​

ts
subscribe(fn, invalidate?): () => void;

The function get's called once with the current value and then when the values changes

Parameters ​

fn ​

(val) => void

invalidate? ​

() => void

Returns ​

a function which should be called to unsubscribe

() => void