This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-07
Channels
- # adventofcode (114)
- # announcements (3)
- # aws (5)
- # babashka (62)
- # beginners (111)
- # calva (4)
- # cider (20)
- # clara (5)
- # clj-kondo (1)
- # cljs-dev (9)
- # clojure (255)
- # clojure-europe (75)
- # clojure-italy (10)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-uk (6)
- # clojuredesign-podcast (5)
- # clojurescript (34)
- # community-development (28)
- # conjure (1)
- # cursive (3)
- # data-science (1)
- # datavis (1)
- # datomic (4)
- # figwheel-main (1)
- # fulcro (14)
- # graalvm (1)
- # graphql (8)
- # integrant (4)
- # introduce-yourself (2)
- # jobs (2)
- # juxt (4)
- # kaocha (2)
- # malli (6)
- # membrane-term (53)
- # mount (2)
- # nextjournal (2)
- # off-topic (27)
- # pathom (11)
- # polylith (3)
- # portal (11)
- # reagent (4)
- # reitit (4)
- # remote-jobs (1)
- # reveal (14)
- # shadow-cljs (22)
- # tools-deps (24)
- # vim (6)
- # xtdb (19)
when using integrant with a server built using ring middleware/handlers, is it idiomatic to assoc the entire component on each request so every handler has access to it? right now I’m only assoc’ing the database connection, but as I move more things out of global atoms and into the component, I’m finding I need access to more and more. Seems like a lot of work just in case, but also feels like a burden on development to have to add individual elements one at a time as I find need for them
What do you mean by the “entire component”. I generally assign each route handler to a key, and then give the handler the dependencies needed.
That’s very interesting! Thanks for the idea
In the current case, the global atom holds which server mode we’re in (`"dev"` or "prod"
) which we use in cljs rendering. On the one hand, doesn’t feel ridiculous to keep around, but on the other, globals 😬