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

    Class ProjectionExtension<TItem>

    Keeps the list of projected fields and always sends it in the payload (an empty list means "every field").

    const projecting = new ProjectionExtension<User>();
    projecting.setProjections([{ field: "id" }, { field: "lastName" }]);
    // payload.projections: [{ field: "id" }, { field: "lastName" }]

    Type Parameters

    • TItem = Any

      Type of the items.

    Hierarchy (View Summary)

    Implements

    Index
    _changeDelay: number
    _eventBus: EventBus<ProjectionExtensionEvents<TItem>>

    Bus used to register handlers and to raise the events.

    _projections: List<Projection<TItem>> = []
    • Registers a handler for an event.

      Type Parameters

      • TKey extends string

        Name of the event to listen to.

      Parameters

      Returns IDisposable

      a subscription; dispose it to remove this single handler.