From f940ac3f38e9ea9129c0d1c77960caf3fa05521a Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Sat, 26 Sep 2015 14:31:06 +0200 Subject: [PATCH] Slimline batching a little --- src/reagent/impl/batching.cljs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/reagent/impl/batching.cljs b/src/reagent/impl/batching.cljs index 6227ca6..55490a6 100644 --- a/src/reagent/impl/batching.cljs +++ b/src/reagent/impl/batching.cljs @@ -36,17 +36,16 @@ (.sort a compare-mount-order) (dotimes [i (alength a)] (let [c (aget a i)] - (when (.' c :cljsIsDirty) - (let [a (.' c :cljsRatom)] - (if (ratom/-check-clean a) - (.! c :cljsIsDirty false) - (.' c forceUpdate))))))) + (when (true? (.' c :cljsIsDirty)) + (if (ratom/-check-clean (.' c :cljsRatom)) + (.! c :cljsIsDirty false) + (.' c forceUpdate)))))) (defn run-funs [a] (dotimes [i (alength a)] ((aget a i)))) -(deftype RenderQueue [^:mutable queue ^:mutable scheduled? +(deftype RenderQueue [^:mutable queue ^:mutable ^boolean scheduled? ^:mutable after-render] Object (queue-render [this c] @@ -113,4 +112,3 @@ (some-> (.' c :cljsRatom) ratom/dispose!) (mark-rendered c)) -