multi-tasks 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,8 @@ let processTask = (task, helper)=>{
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
if(taskCount % 2 === 0){
|
|
81
|
-
|
|
81
|
+
//create a new task if needed
|
|
82
|
+
helper.createNewTasks({
|
|
82
83
|
msg:'a new task'
|
|
83
84
|
});
|
|
84
85
|
return;
|
|
@@ -104,29 +105,12 @@ let processTask = (task, helper)=>{
|
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
|
|
107
|
-
//Example4, dynamically create a new task while processing
|
|
108
|
-
let processTask = (task, helper)=>{
|
|
109
|
-
let {taskCount} = task;
|
|
110
|
-
|
|
111
|
-
return new Promise((resolve, reject)=>{
|
|
112
|
-
setTimeout(()=>{
|
|
113
|
-
if(taskCount % 2 === 0){
|
|
114
|
-
helper.createNewTasks({//create a new task if needed
|
|
115
|
-
msg:'a new task'
|
|
116
|
-
});
|
|
117
|
-
resolve()
|
|
118
|
-
}else{
|
|
119
|
-
resolve({
|
|
120
|
-
data:`task${taskCount} complete`
|
|
121
|
-
})
|
|
122
|
-
}
|
|
123
|
-
}, 10)
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
108
|
```
|
|
127
109
|
|
|
128
110
|
Changelog:
|
|
129
111
|
|
|
112
|
+
- 2.0.9 Update readme examples
|
|
113
|
+
- 2.0.8 Update readme examples
|
|
130
114
|
- 2.0.7 Update changelog
|
|
131
115
|
- 2.0.6 Update readme, remove failed examples
|
|
132
116
|
- 2.0.5 Update readme examples
|