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.