The type of the task worker parameters.
The type of the task worker result.
Use to define group sub tasks.
const subTasks: GroupSubTasksT<[number, number], number> = [
new Task({
worker: (a, b) => a + b,
}),
// task result type must be defined for a task to match with that of
// group sub tasks array, else use unknown or any in group sub tasks
// array
new Task<[number, number], number>({
workerParams: [1, 2],
}),
new Task({
worker: (a, b) => a * b,
workerParams: [3, 4],
}),
];
Use to create template for similar group sub tasks.
type TwoNumbersSubTaskTemplate = GroupSubTasksT<[number, number], number>;
const calcTasks1: TwoNumbersSubTaskTemplate = [
new Task({ worker: (a, b) => a + b }),
new Task({ worker: (a, b) => a - b }),
];
const calcTasks2: TwoNumbersSubTaskTemplate = [
new Task({ worker: (a, b) => a * b }),
new Task({ worker: (a, b) => a / b }),
];
Generated using TypeDoc
The type of group sub tasks.