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

How to start and stop web worker on different routes #39

Open
yantsishko opened this issue Mar 11, 2021 · 0 comments
Open

How to start and stop web worker on different routes #39

yantsishko opened this issue Mar 11, 2021 · 0 comments

Comments

@yantsishko
Copy link

I use comlink-loader in singleton mode.

Web workers inits on app start and not depend on which route open now.
How i can start web worker on certain route and stop it when i go to another one?

I know that i can use close method in worker for stop

export const terminate = () => { close(); };

But after call close() method i can't start worker again without refresh page.

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

1 participant