Fork me on GitHub
#re-frame
<
2021-10-04
>
Joe Douglas15:10:12

Hi, I've been playing around with reg-sub-raw, and something in this http://day8.github.io/re-frame/flow-mechanics/#reg-sub-raw has me scratching my head: where is the reaction function coming from? I can see a macro of that name in the reagent docs, but it's a clojure thing? I've put the snippet below

(defn some-fn
  [app-db event]    ;; app-db is not a value, it is a reagent/atom
  (reaction (get-in @app-db [:some :path])))  ;; returns a reaction

p-himik15:10:45

reaction is indeed a macro. Macros are expanded during CLJS compilation.

Joe Douglas15:10:57

Ahhh ok, thanks!