From 7a69094c3fb7b285c5973ccc5ba52ffb39d12bb4 Mon Sep 17 00:00:00 2001 From: Bluefinger Date: Thu, 16 May 2019 20:15:25 +0200 Subject: [PATCH] Further tweak to recursiveDispatcher --- src/dispatchers/recursiveDispatcher.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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); } };