@metreeca/tile
    Preparing search index...
    • Binds a component to a sliding window over a collection held by the shared store.

      Retrieves from the store offered by the innermost enclosing Store context only the items in view and the batches around them, as useCollection retrieves a whole collection, and counts the collection under the filters the model states, so that a view reserves the room of the items outside the window. The window starts over the first items and follows the items in view as the view reports them, the items held staying on show, where they were taken from, until the new window lands.

      The model is compared by content, so it may be written inline: a model stating something different, as when a filter changes, starts the window again from the first items.

      Type Parameters

      • S extends Lazy<ResourceShape>

        The shape describing the resource holding the collection

      • 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 model naming the property collecting the items and stating which values of each item are wanted

      Parameters

      • options: { entry: string; shape: S; model: T; batch?: number }

        The resource holding the collection, the shape describing it, the model addressing the collection and the number of items in each batch

        • Readonlyentry: string

          The identifier of the resource holding the collection, either absolute or relative to the current location.

        • Readonlyshape: S

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

        • Readonlymodel: T

          The model naming the multi-valued property collecting the items, stating the values wanted from each item along with the criteria filtering and sorting them; any offset or limit it states is overridden.

        • Optional Readonlybatch?: number

          The number of items in each batch.

      Returns Relay<
          {
              blank: void;
              ready: {
                  state: Items<S, T>;
                  offset: number;
                  total: Optional<number>;
                  focus(first: number, last: number): void;
                  create(state: Draft<S, T>): Promise<string>;
              };
              error: { state: Problem; reload(): Promise<void> };
          },
      >

      A Relay over the state of the binding, to be matched by a view with a handler for each: blank until the first window is retrieved, ready with the items in the window, where it stands and the operations on the collection, or error with what prevented either

      Error If called outside any Store context

      RangeError If entry is invalid, or relative while the location is not hierarchical