integrant

NoahTheDuke 2021-04-17T14:52:10.029200Z

okay, so I've poked around with this for the last two days and I have a sense of how it all works but I'm struggling with how, uh, muddy it makes things

NoahTheDuke 2021-04-17T14:52:31.029600Z

this might be due to using sente for websockets

NoahTheDuke 2021-04-17T15:00:46.035600Z

when things like the database connection are global, I can write a simple helper function that can be called from a ring handler or a sente event handler, and it will "just work". but if I move the database connection into a component, then i have to do two things: * I have to make sure that my compojure app accepts the database component and then uses a wrap-component middleware that adds the db connection component to :system/db in the request, and then i have to destructure that in the endpoint handlers and make sure I pass that db connection into the "simple helper" * i have to destructure :ring-req in every sente event-message-handler multimethod and pass it on to the "simple helper" too

NoahTheDuke 2021-04-17T15:03:52.037200Z

this gets worse when there's multiple "global" things I want/need to pass around, such as the atom holding all currently active games, or when a ring handler wants to call the sente send-fn to send a message to a given client

NoahTheDuke 2021-04-17T15:05:31.037700Z

this is a lot to just dump into this channel, lol, so my apologies to all of you who are like "wtf is this dude talking about"