3 ms·
IndexedDB is shared between workers and main thread, in case that helps.
by dassurma 7y ago
IndexedDB is shared between workers and main thread, in case that helps.
- jwr 7y agoIndeed, and it is something I'm looking at. But at the moment my database is really native Clojure data structures, which has fantastic advantages. I would need to start storing them in a "traditional" database, introducing additional layers, serialization, overhead and bugs.
- krn 7y ago> I would need to start storing them in a "traditional" database, introducing additional layers, serialization, overhead and bugs. If the app state is stored in a single atom, I would use localForage[1] (available as a cljsjs package[2]) to keep it in sync between web workers and the main thread. It would also make the app accessible offline. [1] https://github.com/localForage/localForage https://github.com/localForage/localForage [2] https://clojars.org/cljsjs/localforage https://clojars.org/cljsjs/localforage