Skip to content

Add finer control about worker creation#16

Open
cromefire wants to merge 1 commit intojellyfin:old/masterfrom
cromefire:patch-1
Open

Add finer control about worker creation#16
cromefire wants to merge 1 commit intojellyfin:old/masterfrom
cromefire:patch-1

Conversation

@cromefire
Copy link

Allows for better and clearer use, so that there is no implicit (hidden from the user) new Worker() happening.

@cromefire
Copy link
Author

cromefire commented May 24, 2020

Usage in plain js:

const options = {
    workerConstructor() {
        return new Worker("path/to/file.js");
    },
    legacyWorkerConstructor() {
        return new Worker("path/to/file.js");
    },
    [...]
}

With worker-plugin:

const options = {
    workerConstructor() {
        return new Worker("./file.ts", {type: "module"});
    },
    legacyWorkerConstructor() {
        return new Worker("./file.ts", {type: "module"});
    },
    [...]
}

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

Successfully merging this pull request may close these issues.

1 participant