tolitius / mount

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

start-without/stop-except misbehave when states = all states #81

Closed oahner closed 7 years ago

oahner commented 7 years ago

So, as one would expect, start-without and stop-except, when called with all states available in the system, call start/stop with an empty list, which is normally a noop.

Unfortunately the actual call is made with apply, which converts the empty list to a seq, which converts the empty seq to nil, which is what start and stop receive as states (as if they were called with no arguments) and start/stop every state in the system.

tolitius commented 7 years ago

ah. good catch, thanks.

should be fixed in 0.1.12-SNAPSHOT. let me know if it works for you.

when would you start-without / stop-except ALL?

oahner commented 7 years ago

It works!

I stumbled upon that behavior on a project that had two states where one (the webserver) doesn't need to be restarted on reset and I had temporarily commented out the other. End result: the webserver state was suddenly getting restarted on reset.

tolitius commented 7 years ago

ah.. makes sense. thanks for bringing it up