ywana-core8 0.0.772 → 0.0.774

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.772",
3
+ "version": "0.0.774",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -76,11 +76,11 @@ export const TaskContextProvider = (props) => {
76
76
  const interval = setInterval(async () => {
77
77
  const tasks = await API.all()
78
78
 
79
- // invoque listeners for each task
80
- Object.entries(_listeners).forEach(([taskName, listener]) => {
81
- const listenerTasks = tasks.filter(task => task.name === taskName)
82
- listenerTasks.forEach(task => listener(task, value))
83
- })
79
+ // invoque listener for each task
80
+ tasks.forEach(task => {
81
+ const listener = _listeners[task.name || task.action]
82
+ if (listener) listener(task)
83
+ }
84
84
 
85
85
  }, frequency)
86
86
  return () => clearInterval(interval)