This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-17
Channels
- # announcements (2)
- # babashka (52)
- # beginners (10)
- # calva (9)
- # cider (2)
- # clj-kondo (7)
- # clojure (63)
- # clojure-europe (26)
- # clojuredesign-podcast (5)
- # clojurescript (13)
- # datalog (2)
- # datomic (6)
- # defnpodcast (1)
- # fulcro (46)
- # incanter (4)
- # integrant (5)
- # jobs-discuss (12)
- # kaocha (1)
- # lsp (31)
- # malli (10)
- # meander (1)
- # off-topic (6)
- # podcasts-discuss (1)
- # polylith (20)
- # rewrite-clj (6)
- # shadow-cljs (23)
- # tools-deps (9)
- # xtdb (13)
- # yada (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
this might be due to using sente
for websockets
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
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
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"