So, at work we use Stuart Sierras Component system. It’s been serving us well, but IMO, it’s been overused, so we’re cleaning up a bit.
A couple of our services which you could consider stateful, are in fact not, since these days much communication with the outer world is done via http, so you don’t really need a connection, but you do need an address.
It is nice if such addresses are configurable, so naturally, we stick it in a config, which then gets injected into the components.
So you end up with things that don’t need to be components, but which are, because they need access to the config.
So the question then becomes. How do you deal with configurable stuff which is basically static/immutable for the runtime of the app?
Stick it in an atom and deref it?
alter-var-root or some such?
Pass it as a parameter?
Do as we do and have a bunch of non-stateful components?
Use some lib that basically does one of the above?