useQuery
useQuery<
TQuery
>(queryDef
,options?
):GetResult
<TQuery
>
Defined in: useQuery.ts:25
Returns the result of a query and subscribes to future updates.
Example:
const App = () => { const todos = useQuery(queryDb(tables.todos.query.where({ complete: true }))) return <div>{todos.map((todo) => <div key={todo.id}>{todo.title}</div>)}</div>}
Type Parameters
Section titled “Type Parameters”TQuery
Section titled “TQuery”TQuery
extends Any
Parameters
Section titled “Parameters”queryDef
Section titled “queryDef”TQuery
options?
Section titled “options?”store?
Section titled “store?”Store
<LiveStoreSchema
<DbSchema
, EventDefRecord
>, { }>
Returns
Section titled “Returns”GetResult
<TQuery
>