reactjsrustindexeddbdexie

How to use useLiveQuery in JavaScript while writing to IndexedDB from WebAssembly


Is it possible use useLiveQuery from 'dexie-react-hooks' when writing to IndexedDB from WebAssembly (using Rexie)?

I've tried implementing it, but useLiveQuery is not updating. I think this might be because the database transactions need to go through the js Dexie db instance, but I'm not sure. Is there a way to make this work?


Solution

  • useLiveQuery() will only detect updates done via Dexie.js, so if another indexedDB wrapper is used it will not detect changes since there are no native reactivity in indexedDB.