-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
题目
const input = [{
id: 'task1',
deps: [],
runTask: () => 3,
}, {
id: 'task2',
deps: ['task1', 'task3'],
// res1 task1的 runTask(), res3 task3的runTask()
runTask: (res1, res3) => 1 + res1 + res3,
}, {
id: 'task3',
deps: ['task1'],
runTask: (res1) => 5 + res1,
}, {
id: 'task4',
deps: ['task1', 'task2'],
runTask: (res1, res2) => 3 + res1 + res2,
}, ];
runAllTask(input, (err, res) => {
console.log(res);
/**
res应该为:
{ task1: 3, task2: 12, task3: 8, task4: 18 }
*/
});Metadata
Metadata
Assignees
Labels
No labels