Fork me on GitHub

This isn't in the documentation (at least I haven't seen) but I figured I could do it in the repl, pretty nice 🙂

(reset! re-frame.db/app-db (assoc-in @re-frame.db/app-db [:dataview :show-spinner] false))


swap! would be the preferred way to do this.

(swap! re-frame.db/app-db assoc-in [:dataview :show-spinner] false)
However, directly accessing app-db isn't really encouraged (app-db is an implementation detail of re-frame). I find myself dispatching events from a repl manually when I want to do something similar
(ns my.stuff  ...)
  (fn [db _]
    (assoc-in db [:dataview :show-spinner] false)))

;; Later from your repl
(rf/dispatch [:my.stuff/stop-spinning])


Yeah, you wouldn’t want to code your app to directly tweak app-db like that, but if you’re just doing some quick hacking at the repl it’s fine. A typo or other goof might screw something up, but worst case you just need to reload the page and get a fresh app-db.


Also +1 on the swap! instead of reset! above.


I agree 🙂