From 610bc3ec44f51a553ae10c7ca91f05655ef6a9bd Mon Sep 17 00:00:00 2001 From: Daniel Compton Date: Tue, 1 Sep 2015 20:48:06 +1200 Subject: [PATCH] Log warning when non reactive parameters are passed to dynamic subscriptions Closes #115 --- src/re_frame/subs.cljs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/re_frame/subs.cljs b/src/re_frame/subs.cljs index 4907f3f64..ffcac7bb0 100644 --- a/src/re_frame/subs.cljs +++ b/src/re_frame/subs.cljs @@ -34,6 +34,9 @@ ([v dynv] (let [key-v (first-in-vector v) handler-fn (get @key->fn key-v)] + (when ^boolean js/goog.DEBUG + (when-let [not-reactive (seq (remove #(implements? reagent.ratom/IReactiveAtom %) dynv))] + (warn "re-frame: dynv contained parameters that don't implement IReactiveAtom: " not-reactive))) (if (nil? handler-fn) (error "re-frame: no subscription handler registered for: \"" key-v "\". Returning a nil subscription.") (let [dyn-vals (reaction (mapv deref dynv))