Interface UseQueryParams<T>

Parameters for useQuery.

interface UseQueryParams<T> {
    localOnly?: boolean;
    onError?: ((error) => void);
    persistenceDirectory?: string;
    queryArguments?: T;
}

Type Parameters

  • T extends DQLQueryArguments = DQLQueryArguments

    The type of query arguments.

Properties

localOnly?: boolean

Whether to run the query locally only.

Setting this to true will skip setting up a SyncSubscription that syncs documents with remote peers. Consequently, the syncSubscription property of the return value will be undefined.

onError?: ((error) => void)

A callback to run when an error occurs.

Type declaration

    • (error): void
    • Parameters

      • error: unknown

      Returns void

Returns

persistenceDirectory?: string

Identifies the Ditto instance to use when multiple instances are registered in the DittoProvider. Defaults to the first registered instance.

See Ditto.absolutePersistenceDirectory.

queryArguments?: T

The arguments to pass to the query.