tolitius / mount

managing Clojure and ClojureScript app state since (reset)
Eclipse Public License 1.0
1.22k stars 88 forks source link

have an option to not restart on recompile #36

Closed tolitius closed 8 years ago

tolitius commented 8 years ago

when a namespace gets recompiled, in case it had states defined inside, it would stop and start (i.e. restart) these states to make sure they are not lost / bound to resources (more details).

this is usually a preferred behavior, but in some instances (see this discussion) it would be best to not restart states on recompile.

this needs more thinking so the original state references are not lost after "not restarting".

tolitius commented 8 years ago

could be for all:

(mount/on-reload :noop / :stop / :restart)

or per state:

(defstate ^{:on-reload :noop} a :start 42)

i.e. :noop / :stop / :restart

tolitius commented 8 years ago

docs are in.