Fork me on GitHub

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

🎉 8

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.


@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?


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.