@mantlebee/ts-data
    Preparing search index...

    Type Alias DataSourceReader<TItem, TResult>

    DataSourceReader: QueryItemsReader<TItem, TResult>

    Function that resolves a payload into a result: the items of the data source, or anything else an extension needs (e.g. the total count). The same as QueryItemsReader, named from the data source's point of view: the optional signal is aborted when the read is superseded by a newer one, so a reader can hand it to fetch.

    Type Parameters

    • TItem = Any
    • TResult = List<TItem>
    const readUsers: DataSourceReader<User> = (payload, signal) =>
    fetch("/users", { body: JSON.stringify(payload), method: "POST", signal }).then((a) => a.json());