• Continuously fetch results for the provided query.

    Configures both a StoreObserver and a SyncSubscription to keep results up-to-date with local and remote changes.

    Type Parameters

    • T = any

      The type of query result items. Be aware that this is a convenience type that is not checked against the query being run.

    • U extends DQLQueryArguments = DQLQueryArguments

      The type of query arguments.

    Parameters

    • query: string

      The query to run. Must be a non-mutating query.

    • Optional params: UseQueryParams<U>

      Additional parameters to configure how the query is run.

    Returns UseQueryReturn<T>

    Example

    const { items } = useStoreObserver(
    'select * from tasks where _id = :id limit 10', {
    queryArguments: { id: '123' },
    }
    )