Fork me on GitHub
Noah Bogart14:04:10

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

Noah Bogart14:04:31

this might be due to using sente for websockets

Noah Bogart15:04:46

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

Noah Bogart15:04:52

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

Noah Bogart15:04:31

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"