Prometheus Entity Management API
    Preparing search index...

    Class EntityListController<TRaw, TEntity>

    Lit 3 ReactiveController that subscribes to an entity list in the graph.

    class InvoiceList extends LitElement {
    readonly #list = new EntityListController<RawInvoice, Invoice>(this, "Invoice", {
    queryKey: ["invoices", { status: "open" }],
    fetch: (params) => api.listInvoices(params),
    normalize: (raw) => ({ id: raw.id, data: raw }),
    });

    render() {
    return html`
    ${this.#list.items.map((inv) => html`<li>${inv.title}</li>`)}
    ${this.#list.hasNextPage
    ? html`<button @click=${() => this.#list.loadMore()}>Load more</button>`
    : nothing}
    `;
    }
    }

    Type Parameters

    • TRaw
    • TEntity extends object

    Implements

    • ReactiveController
    Index
    error: string | null
    hasNextPage: boolean
    isLoading: boolean
    isLoadingMore: boolean
    items: TEntity[]
    total: number | null
    • Called when the host is connected to the component tree. For custom element hosts, this corresponds to the connectedCallback() lifecycle, which is only called when the component is connected to the document.

      Returns void

    • Called when the host is disconnected from the component tree. For custom element hosts, this corresponds to the disconnectedCallback() lifecycle, which is called the host or an ancestor component is disconnected from the document.

      Returns void

    • Append the next page. No-op when hasNextPage is false or a fetch is already in progress.

      Returns void

    • Force a full refetch (replaces ids from page 1).

      Returns void