Files
coopgo/node_modules/@react-dnd/asap/dist/esm/TaskFactory.mjs
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

16 lines
424 B
JavaScript

import { RawTask } from './RawTask.mjs';
export class TaskFactory {
create(task) {
const tasks = this.freeTasks;
const t1 = tasks.length ? tasks.pop() : new RawTask(this.onError, (t)=>tasks[tasks.length] = t
);
t1.task = task;
return t1;
}
constructor(onError){
this.onError = onError;
this.freeTasks = [];
}
}
//# sourceMappingURL=TaskFactory.mjs.map