Skip to content

API reference > @kontsedal/olas-core > createQuery

createQuery() function ​

Subscribe this controller to an infinite query (§5.11). The subscription adds pages, flat and the paging state and actions to theAsyncState<TPage[]> surface.

Needs a query engine on the root.

Signature:

typescript
export declare function createQuery<Args extends unknown[], TPage, TItem>(ctx: Ctx, source: InfiniteQuery<Args, TPage, TItem>, keyOrOptions?: (() => readonly [...Args]) | QuerySubscriptionOptions<Args>): InfiniteQuerySubscription<TPage, TItem>;

Parameters ​

Parameter

Type

Description

ctx

Ctx

source

InfiniteQuery<Args, TPage, TItem>

keyOrOptions

(() => readonly [...Args]) | QuerySubscriptionOptions<Args>

(Optional)

Returns:

InfiniteQuerySubscription<TPage, TItem>

Released under the MIT License.