Interface MinimalWritableFn<T, Args, R>

Combines a minimal writable Svelte store with a callable function. This type allows a minimal writable store to also act as a function enabling flexible reactive behavior.

interface MinimalWritableFn<T, Args extends unknown[], R = void> {
    set(this: void, value: T): void;
    subscribe(
        this: void,
        run: Subscriber<T>,
        invalidate?: Invalidator<T>,
    ): Unsubscriber;
    (...args: Args): R;
}

Type Parameters

  • T

    The type of value stored in the minimal writable store.

  • Args extends unknown[]

    The tuple of argument types accepted by the function.

  • R = void

    The return type of the function.

Hierarchy
  • Parameters

    Returns R

Index
  • Set value and inform subscribers.

    Parameters

    • this: void
    • value: T

      to set

    Returns void