tolitius / mount

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

start-with-states only works with functions #82

Closed didibus closed 7 years ago

didibus commented 7 years ago

I've noticed that when using start-with-states, you have to wrap all yous start and stop states in a function. This is different from the defstate macro, which support scalars and literals and vars, etc.

tolitius commented 7 years ago

the idea is that in case you need "scalars and literals and vars, etc." you can use start-with instead.

you would normally use start-with-states when you need functions: i.e. to create something and then to destroy it.

this is also consistent with swap vs. swap-states when you compose states.

didibus commented 7 years ago

Ah ok, makes sense.