diff --git a/src/dispatchers/recursiveDispatcher.ts b/src/dispatchers/recursiveDispatcher.ts index e11d438..787e9b2 100644 --- a/src/dispatchers/recursiveDispatcher.ts +++ b/src/dispatchers/recursiveDispatcher.ts @@ -3,15 +3,10 @@ import { markActive } from "./helpers/markActive"; import { markDependencies } from "./helpers/markDependencies"; import { shouldApplyValue } from "./helpers/shouldApplyValue"; -const hasDependencies = (cell: Cell, first?: true) => { +const hasDependencies = (cell: Cell) => { + markActive(cell); if (cell.dependents.length) { - if (first) { - markDependencies(cell); - } - markActive(cell); updateDependencies(cell); - } else { - markActive(cell); } }; @@ -32,6 +27,7 @@ const updateDependencies = (cell: Cell) => { */ export const recursiveDispatcher = (cell: Cell, value: T) => { if (shouldApplyValue(cell, value) && cell.state) { - hasDependencies(cell, true); + markDependencies(cell); + hasDependencies(cell); } };