Configuration accepted by resource.

interface ResourceOptions<T> {
    loader: (origin: number) => Promise<T>;
    stalenessGuard?: boolean;
}

Type Parameters

  • T

    Resolved value type produced by the loader.

Properties

loader: (origin: number) => Promise<T>

A Loader: invoked on fetch(). Receives the originating GraphTime.

stalenessGuard?: boolean

If true (the default), a fetch that resolves AFTER another commit advanced GraphTime past origin is reported as stale. Set to false to treat late resolves as authoritative (last-writer-wins).