@metreeca/pipe
    Preparing search index...

    Function lookup

    Retrieves a resource, or the items of a collection it holds, from the store.

    • Retrieves the items of a collection held by a resource in the store.

      The request names a resource and a slice of it. A slice is a model with a single entry: a property holding any number of resources, together with the members to retrieve from each of them. The feed returns the items one by one, each typed as a frame of the slice, rather than the resource holding them.

      A model naming any further member, such as id, retrieves the resource itself rather than the items it holds.

      If the store does not hold the resource, or the collection holds no items, the feed is empty.

      The resource is read from the store bound to the current execution.

      Type Parameters

      • S extends Lazy<ResourceShape>

        The shape of the resource holding the collection, possibly deferred to break definition cycles

      • T extends
            | Model<S, T>
            | Template & Entries<S, T>
            | Template & Entries<S, T> & {
                readonly [F in string | number | symbol]: F extends Repeated<S>
                    ? Collecting<S, F, T[F]>
                    : never
            }

        The slice naming the collection and the members to retrieve from its items

      Parameters

      • request: StoreLookup<S, T>

        The resource to retrieve and the slice to retrieve it with

      Returns Feed<Frame<S, T>>

      A feed of the items of the collection, each restricted to the members the slice names

      Error If no store is bound to the current execution

    • Retrieves a resource from the store.

      The request names a resource and a model of the members to retrieve from it. The feed returns the resource once, typed as a match of the model and restricted to the members it names.

      A model naming a single collection of resources and nothing else is a slice: the feed then returns the items of the collection, each typed as a frame, rather than the resource holding them.

      If the store does not hold the resource, the feed is empty.

      The resource is read from the store bound to the current execution.

      Type Parameters

      • S extends Lazy<ResourceShape>

        The shape of the resource, possibly deferred to break definition cycles

      • T extends Model<S, T>

        The model naming the members to retrieve from the resource

      Parameters

      • request: StoreLookup<S, T>

        The resource to retrieve and the model to retrieve it with

      Returns Feed<Match<S, T>>

      A feed of the resource, restricted to the members the model names

      Error If no store is bound to the current execution