Container to track a query execution on a queryable source.

interface QueryExecution<T> {
    cancel(): void;
    error?: Error;
    executed: boolean;
    parameters?: any[];
    queryResult?: QueryResult<T>;
    result?: readonly T[];
    run(): Promise<QueryExecution<T>>;
    running: boolean;
    source?: DataSource<T>;
    title: string;
    total?: number;
    waitForExecution(): Promise<QueryExecution<T>>;
    watch(property, cb): WatchHandle;
}

Type Parameters

  • T

Hierarchy (view full)

Properties

error?: Error

Error to indicate query failures.

executed: boolean

Indicates that the execution is finished.

parameters?: any[]

Parameters used to control the query.

queryResult?: QueryResult<T>

Pending query.

result?: readonly T[]

Results of the executed query.

running: boolean

Indicates that the execution is running.

source?: DataSource<T>

Source of the query that must have a query method.

title: string

Title of the execution.

total?: number

Total number of available items in the result, if the query was paginated

Methods

  • Function to cancel/stop the current execution.

    Returns void

  • Function to trigger the execution.

    Returns Promise<QueryExecution<T>>

  • Helper function to wait until the execution is finished.

    Returns Promise<QueryExecution<T>>

  • Function to watch for changes on a property.

    Parameters

    • property: string

      name of the property to watch

    • cb: WatchCallback<string, any>

      event handler executed on changes

    Returns WatchHandle

Generated using TypeDoc