vue-worker
vue-worker copied to clipboard
vuex and vue-worker
Is it possible to access the vuex store from within a function passed onto a worker ?
I'd like to know this too, please.
I would like to know simply how to call a worker from a VueX action. Can somebody provide some guidance?
Is it possible to access the vuex store from within a function passed onto a worker ?
This is likely not possible (or not feasible), because Web Workers don't share any data with the main thread. By design, communication between workers is done by passing messages, and such data is copied but never "shared".
While technically it could be possible to set up a bunch of messages so that a worker could ask for data from the main thread, this is likely going to increase the overhead and the complexity of the code, and making it much slower to run and harder to maintain.
Not true. Currently indexedb is blocking - and if you want to sync the store with your indexedb instance without freezing the DOM - using workers is the only way to make it truly non blocking. And yes, it is possible. The app will be faster. However I do not know if the module allows it, I have used worker-loader module before.