ywana-core8 0.0.697 → 0.0.698

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.697",
3
+ "version": "0.0.698",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -48,7 +48,7 @@ export const TaskContextProvider = (props) => {
48
48
 
49
49
  async function removeTask(id) {
50
50
  try {
51
- removeTaskListeners(id)
51
+ removeListener(id)
52
52
  const response = await API.remove(id);
53
53
  return response;
54
54
  } catch (error) {
@@ -64,12 +64,14 @@ export const TaskContextProvider = (props) => {
64
64
 
65
65
  function removeListener(taskId) {
66
66
  const newListeners = listeners.filter(listener => listener.taskId !== taskId)
67
+ console.log("removeListener", taskId, newListeners)
67
68
  setListeners(newListeners)
68
69
  }
69
70
 
70
71
  useEffect(() => {
71
72
  const interval = setInterval(async () => {
72
73
  const tasks = await API.all()
74
+ console.log(listeners)
73
75
  listeners.forEach(({ taskId, listener }) => {
74
76
  const task = tasks.find(task => task.id === taskId)
75
77
  if (task) listener(task)