Skip to content

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

@yantsishko

Description

@yantsishko

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions