This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-27
Channels
- # admin-announcements (72)
- # beginners (121)
- # boot (9)
- # business (1)
- # cider (6)
- # cljs-dev (2)
- # cljsjs (8)
- # cljsrn (12)
- # clojure (142)
- # clojure-dev (5)
- # clojure-nl (7)
- # clojure-russia (41)
- # clojure-uk (3)
- # clojurecup (1)
- # clojurescript (351)
- # cursive (45)
- # data-science (1)
- # datavis (5)
- # datomic (7)
- # editors (6)
- # editors-rus (15)
- # emacs (53)
- # hoplon (1)
- # ldnclj (53)
- # lein-figwheel (7)
- # liberator (2)
- # om (73)
- # onyx (28)
- # re-frame (1)
- # reagent (3)
- # yada (7)
Hello, I am trying to inject component
dependencies into bidi
routes. My RouteProvider
function is never called, I am not sure how I am supposed to use it. Here are my attempts, I would appreciate any help : https://www.refheap.com/112132
Hi @nha did you realise that you have to pass the component that behaves as a RouteProvider to a proper component modular.bidi/Router? https://github.com/juxt/chatserver/blob/18a0671d8678a8a02eac6f53119a1cff7469f1d1/src/chatserver/system.clj#L99-L101
@tangrammer: Ah not at all thanks. This is why my route
fn was not called then. I will dig into that, thanks
@nha: @tangrammer is right, RouteProvider is really a marker protocol you can use to build your own component-based router, or use the one in modular.bidi for an idea
most people hijack the Ring request for dependency injection, I think that's a bit of a hacky solution
I prefer to inject dependencies the idiomatic way that Stuart Sierra suggests