Fork me on GitHub
#mount
<
2018-11-12
>
pablore18:11:39

Hi! Does mount’s start-with only start the supplied states or does it start the other states too but without the replace value?

pablore18:11:18

Or more specific to my problem: I have a configuration state Config and a Database state which depends on Config. For testing I want to start-with my Config with testing values. Will the Database state change when I start the Config with the custom value?

tolitius19:11:52

@pablore start-with will start everything swapping states in a start-with map: i.e.

(mount/start-with {#'app.env/config {:db {:uri "test-uri"}}})
will start all the components with {:db {:uri "test-uri"}} instead of the "original" config state

tolitius19:11:01

I would recommend using swap instead though which will do the same thing, it just can be later composed with other filters