ywana-core8 0.0.839 → 0.0.841
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/dist/index.cjs +8 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +8 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/incubator/task.js +9 -2
package/package.json
CHANGED
package/src/incubator/task.js
CHANGED
@@ -78,12 +78,18 @@ export const TaskContextProvider = (props) => {
|
|
78
78
|
}
|
79
79
|
|
80
80
|
function addListener(taskID, listener) {
|
81
|
-
const next = {
|
81
|
+
const next = Object.assign({}, listeners)
|
82
|
+
next[taskID] = listener
|
83
|
+
setListeners(next)
|
84
|
+
}
|
85
|
+
|
86
|
+
function addListeners(newListeners) {
|
87
|
+
const next = Object.assign({}, listeners, newListeners)
|
82
88
|
setListeners(next)
|
83
89
|
}
|
84
90
|
|
85
91
|
function removeListener(taskID) {
|
86
|
-
const next = {
|
92
|
+
const next = Object.assign({}, listeners)
|
87
93
|
delete next[taskID]
|
88
94
|
setListeners(next)
|
89
95
|
}
|
@@ -96,6 +102,7 @@ export const TaskContextProvider = (props) => {
|
|
96
102
|
removeTask,
|
97
103
|
listeners,
|
98
104
|
addListener,
|
105
|
+
addListeners,
|
99
106
|
removeListener
|
100
107
|
};
|
101
108
|
|