Skip to content

Instantly share code, notes, and snippets.

@qleguennec

qleguennec/cljs Secret

Created April 12, 2021 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qleguennec/8972c880c8baa0e7dc3800ae3fec1737 to your computer and use it in GitHub Desktop.
Save qleguennec/8972c880c8baa0e7dc3800ae3fec1737 to your computer and use it in GitHub Desktop.
(defonce value-atom (r/atom nil))
(re-frame/reg-sub
:test-reaction
(fn test-reaction-input [_]
value-atom)
(fn test-reaction [first-value]
(inc first-value)))
(r/track!
(fn []
(println
@(re-frame/subscribe [:test-reaction]))))
(do
(re-frame/clear-subscription-cache!)
(reset! value-atom 42))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment