use-run-in-worker
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Run In Worker

Install

npm i -S use-run-in-worker

Usage

For React Hooks

import UseRunInWorker from "use-run-in-worker";

const [sortWorker, { kill }] = UseRunInWorker(function () {});

sortWorker(1, 2).then((data) => { });

online demo

For CDN

<script src="https://unpkg.com/use-run-in-worker/dist/runInWorker.js"></script>

<script>
  const run = runInWorker(function () {});

  run.start(1, 2).then((data) => {});
</script>

modified from alewin/useWorker.

Readme

Keywords

Package Sidebar

Install

npm i use-run-in-worker

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

597 kB

Total Files

39

Last publish

Collaborators

  • lecepin