This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-21
Channels
- # admin-announcements (17)
- # aws (19)
- # beginners (28)
- # boot (103)
- # cider (5)
- # clojure (183)
- # clojure-art (46)
- # clojure-russia (25)
- # clojure-sg (2)
- # clojure-uk (1)
- # clojurescript (342)
- # clojurex (3)
- # core-matrix (1)
- # cursive (1)
- # datascript (2)
- # devcards (77)
- # devops (15)
- # emacs (4)
- # funcool (8)
- # hoplon (15)
- # immutant (47)
- # jobs (1)
- # ldnclj (10)
- # lein-figwheel (4)
- # off-topic (2)
- # om (23)
- # onyx (10)
- # re-frame (1)
- # reagent (23)
- # yada (7)
Hi, Omists! I need help 😉 I have Om component which I consider opaque for my code, but I want its render function to have some custom var bindings. But (binding [...] (om/build OpaqueComponent ...)
does not have desired effect, of course, because render is called not inside this form.
@ul: I’m afraid you would have to take OpaqueComponent and pass a new component to om/build which wraps OpaqueComponent’s IRender or IRenderState functions into your binding form
yes, but i'm trying to substitute some global values in OpaqueComponent. I'm using modifed re-frame with Om
@ul yes, I’m looking into om sources, you basically have to override IRender and IRenderState methods with your wrappers
an alternative solution would be to write your own re-frame loop and make dispatch function more flexible
this can be done by not requiring re-frame.core and requiring just other namespaces except router, you would have to copy&paste their loop and make needed changes
i have custom loop and custom om instrument for subscriptions. so its not a problem to pass db to component and to dispatch from component. but I have ambition to not change component code for passing db to dispatch
makes sense, it looks like it is doable with specify!, that is what om uses internally to define various protocol methods when building component
@darwin: if you are interested, i solved the problem with providing custom :descriptor
for om/build
here descriptor customization https://github.com/condense/ampere/blob/master/src/ampere/om.cljs#L109
@ul: looks good! thanks for sharing, and ampere looks like a cool project, I have one Om project and eventually I would like to switch to re-frame there too