cljsrn

2021-10-29T17:47:43.002900Z

hi everybody! I'm trying to figure out hot reloading in Krell when working with re-frame. Looking at the example the main/init function is executed every time Krell reloads code so I don't know where to dispatch re-frame initial event to set initial state in a way it doesn't smash my state everytime I make a change. Is there something like shadow-cljs :dev/after-load in Krell?

dnolen 2021-10-29T19:06:33.003800Z

@jpmonettas you can use defonce it's simple enough, we use re-frame and those dbs are in separate namespaces so generally not reloaded when editing the UI

2021-10-29T19:08:59.005200Z

hmm not following, where should I dispatch my app initialization event? the one that will set up initial state, start setIntervals, connect to sqlite etc? If I do it from main it will happen on every file reload

2021-10-29T19:11:11.006100Z

normally the only thing that happens on reload on my re-frame apps is react component remounting, everything else stays the same