Do people stick to the dependency injection pattern religiously or sometimes store config in a atom also? I'm passing a lot of parameters between functions.
The other thing I see people do is use a closure to define reitit routes, and per each route add the dependency (say db connection) on the route data so you don’t have to use closures for the handlers. Pretty neat too, but this way, middlewares also get access
I probably just need to use more closures.
My other trick is custom middleware to inject the 'system' into the ring request so it is available to all my handlers.
It depends on your application. I do use closures a fair bit, but I'd need to see your application config before I could give any specific advice.
I'll all put on GitHub soon.