The type of the task worker parameters.
The type of the task worker result.
Rest
...workerParams: TUse to define a task worker function.
const moviesGetter: TaskWorkerT<[url: string], Promise<JSON>> = async (url) => {
const response = await fetch(url);
const movies = await response.json();
return movies;
};
Use to create a template for similar task worker functions.
type TwoNumbersWorkerTemplate = TaskWorkerT<[number, number], number>;
const adder: TwoNumbersWorkerTemplate = (a, b) => a + b;
const multiplier: TwoNumbersWorkerTemplate = (a, b) => a * b;
Generated using TypeDoc
The type of the task worker function.