integrant

Joseph Graham 2025-03-14T11:53:06.731179Z

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.

Ovi Stoica 2025-05-08T14:19:03.312139Z

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

Joseph Graham 2025-03-14T12:03:12.883619Z

I probably just need to use more closures.

☝️ 2
wevrem 2025-03-14T15:15:49.863159Z

My other trick is custom middleware to inject the 'system' into the ring request so it is available to all my handlers.

➕ 3
weavejester 2025-03-14T15:39:33.266819Z

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.

Joseph Graham 2025-03-14T15:41:45.747099Z

I'll all put on GitHub soon.