From ce1486a7cd4b52b9763885f33de60daeeabbdb94 Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Mon, 14 Sep 2015 21:11:33 +0200 Subject: [PATCH] Make sure on-set is valid before allowing change of Reaction --- src/reagent/ratom.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reagent/ratom.cljs b/src/reagent/ratom.cljs index 7a2a5bc..49c7206 100644 --- a/src/reagent/ratom.cljs +++ b/src/reagent/ratom.cljs @@ -285,10 +285,10 @@ IReset (-reset! [a newval] + (assert (ifn? on-set) "Reaction is read only.") (let [oldval state] (set! state newval) - (when (some? on-set) - (on-set oldval newval)) + (on-set oldval newval) (-notify-watches a oldval newval) newval))