how to use indexeddb with react query (dexie.js)

im working on a project that doesnt have a hosted database, everything is done locally. im using dexie.js as my indexeddb wrapper, and im wondering if/how i can use react query with indexeddb instead.
1 Reply
Liam Idrovo
Liam Idrovo14mo ago
You can use React Query for any sort of asynchronous calls.
const fetcher = async () => {
// code that communicates with db
}

const query = useQuery({
queryKey: ['blabla],
queryFn: fetcher
})
const fetcher = async () => {
// code that communicates with db
}

const query = useQuery({
queryKey: ['blabla],
queryFn: fetcher
})
Does this answer your question?