usePowerSyncWatchedQuery()
function usePowerSyncWatchedQuery<T>(
sqlStatement,
parameters?,
options?): T[]
Type parameters
Type parameter | Value |
---|---|
T | any |
Parameters
Parameter | Type |
---|---|
sqlStatement | string |
parameters ? | any [] |
options ? | Omit <SQLWatchOptions , "signal" > |
Returns
T
[]
Deprecated
use useQuery instead.
A hook to access the results of a watched query.
Example
export const Component = () => {
const lists = usePowerSyncWatchedQuery('SELECT * from lists');
return <View>
{lists.map((l) => (
<Text key={l.id}>{JSON.stringify(l)}</Text>
))}
</View>
}