Skip to content

Commit

Permalink
Log warning when non reactive parameters are passed to dynamic subscr…
Browse files Browse the repository at this point in the history
…iptions

Closes #115
  • Loading branch information
danielcompton committed Sep 27, 2015
1 parent e01023a commit 610bc3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/re_frame/subs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 610bc3e

Please sign in to comment.