Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vuex and vue-worker #12

Open
devszr opened this issue Mar 20, 2018 · 4 comments
Open

vuex and vue-worker #12

devszr opened this issue Mar 20, 2018 · 4 comments

Comments

@devszr
Copy link

devszr commented Mar 20, 2018

Is it possible to access the vuex store from within a function passed onto a worker ?

@rconstantine
Copy link

I'd like to know this too, please.

@alejandroiglesias
Copy link

I would like to know simply how to call a worker from a VueX action. Can somebody provide some guidance?

@denilsonsa
Copy link

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.

@siloam
Copy link

siloam commented Jul 14, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants