virgil icon indicating copy to clipboard operation
virgil copied to clipboard

defonce does not persist values across reloads

Open EmmanuelOga opened this issue 4 years ago • 0 comments

Once virgil notices a change on a .java file it recompiles everything on the folder and reloads every namespace. Any value inside a defonce is lost.

I was wondering what's would be a good solution here?

Other than "fixing" the issue (I assume would require additional machinery), other options that can think;

  • Supplying a list of namespaces that shouldn't be reloaded when recompiling.
  • Supplying some sort of on-stop/on-start method per namespace (like shadow-cljs or figwheel do) such that I can clear/reset the value (in my case it is holding an atom for the PID of a server, the server should be stopped before the NS is reloaded).

Let me know your thoughts!

EmmanuelOga avatar Jul 10 '20 06:07 EmmanuelOga