Skip to content

Releases: AndersCan/typed-web-workers

4.0.0

13 Mar 08:37
Compare
Choose a tag to compare

build(rollup): generate builds using rollup
creates a cjs, esm and iife bundle

BREAKING CHANGE: Build output changes might break your build (hopefully it won't).

3.0.0

13 Mar 08:34
972b00e
Compare
Choose a tag to compare

BREAKING CHANGE: createWorker: now takes named parameters of type ICreateWorkerProps.

BREAKING CHANGE: workerFunction: now takes named parameters: {input, callback, getState, setState}

workerFunction: added getState and setState params.

added importScripts for importing scripts in worker

added onError when an unhandled exception is thrown

createWorker({
  workerFunction: ({input, callback, getState, setState}) => {...},
  onMessage: output => {...},
  onError: error => {...},
  importScripts: ['https://www.url.to/your/script.js']
})

Only workerFunction is required in ICreateWorkerProps.
onError - called when an unhandled exception is thrown
importScripts - imports commonjs/umd scripts.