Hi - anyone know if I can start just one component with a particular state?
@rod do u mean a mount state?. u could swap a state with another one of u prefer using mount/swap
. there r other alternatives depending on what you want to do.
thanks @jmayaalv - my situation is for a unit test i want to mock my app.config/config
state, but i don't want to start the entire system to do it (i think i could use start-with
or swap
but i'd then need to specify all of my states to disable (like database connections and other services). so i really just want to say (mount/start {#app/config {:some "config}})
and have only that state started. does that make sense?
like... (mount/start-only ...)
i guess would fit?
oh wait, can i do that with... (-> (only #{app/config x}) (start))
I'll try...
yes!
(-> (only #{#'app.config/config})
(swap {#'app.config/config {:some "config"}))
(start))