mount

rod 2017-11-23T13:44:59.000242Z

Hi - anyone know if I can start just one component with a particular state?

2017-11-23T14:23:39.000279Z

@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.

rod 2017-11-23T14:28:24.000228Z

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?

rod 2017-11-23T14:29:05.000111Z

like... (mount/start-only ...) i guess would fit?

rod 2017-11-23T14:29:46.000194Z

oh wait, can i do that with... (-> (only #{app/config x}) (start)) I'll try...

rod 2017-11-23T14:37:50.000021Z

yes!

(-> (only #{#'app.config/config})
    (swap {#'app.config/config {:some "config"}))
    (start))

👏 1