0.0.11 • Published 5 years ago

function-to-worker v0.0.11

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

function-to-worker

function-to-worker is a package designed for run any synchronous functions in web workers scope. It lets to make calculations without blocking main js thread.

Usage

Package provide only one simple function which makes worker from passed function:

import createWorker from "function-to-worker";

const wantToCalculateItInWorker = number => number + 1;
const calculateInWorker = createWorker(wantToCalculateItInWorker);

function calculateInWorker from example above returns Promise which will resolved or rejected with value was returned by wantToCalculateItInWorker function. So, we can use it like this:

const addOneInWorker = async number => await calculateInWorker(number);
0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.0

5 years ago

0.0.1

5 years ago