Fork me on GitHub
Luis Santos18:09:24

Hi everyone, Is there a way to refresh the scene every time one of my "components" gets re-evaluated? I was looking for a way to do this with nrepl and cider. More details here: Thanks


You have your state atom somewhere, call (swap! the-atom identity)


You can probably setup your editor to send this form on some keystroke

Luis Santos20:09:34

Hi @U47G49KHQ , Thank you very much for you support. Refreshing the scene when the state changes is working as expected. My challenge is to refreshing the scene when the one of the component (functions) gets updated via repl.

Luis Santos20:09:39

Currently I have to run the renderer function every time one of the components changes.

(def renderer
   :middleware (fx/wrap-map-desc (fn [state]
                                   {:fx/type root-view
                                    :state state}))
   :opts {:fx.opt/map-event-handler event-handler}))


You could have a save hook in your editor that issues the right command, that’s what I mostly do. That said, I often find just resizing the window is convenient enough to trigger a redraw.