Fork me on GitHub
#re-frame
<
2018-08-31
>
benzap00:08:45

Ah, you are correct @mikerod, I cleaned out my builds and it seems to be working now. Thanks for the suggestion!

🎉 8
zane05:08:58

What's the best way to call a function only on startup and not on reloads triggered by Figwheel? We've been using defonce, but that feels like a hack. We also tried calling the function directly inside a window.onload in a script tag in the HTML, but it seems like not all of the cljs is available at the time that window.onload runs. As a result we sometimes get errors about the function being undefined.

ingesol06:08:50

@zane If you put the init stuff in a separate namespace, required from the root namespace, it won't get reloaded by figwheel if it isn't changed. At least I think this is true?

ingesol06:08:44

As an example, re-frame state such as app-db is initialized once in the app lifetime, because it is in its own ns, never reloaded.