This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws (1)
- # beginners (15)
- # boot (30)
- # cider (13)
- # cljsrn (16)
- # clojure (458)
- # clojure-dev (15)
- # clojure-france (131)
- # clojure-greece (124)
- # clojure-korea (2)
- # clojure-spec (42)
- # clojure-uk (115)
- # clojure-ukraine (1)
- # clojurescript (103)
- # component (18)
- # cryogen (1)
- # datomic (4)
- # dirac (3)
- # figwheel (1)
- # funcool (13)
- # hoplon (60)
- # luminus (2)
- # off-topic (2)
- # om (28)
- # onyx (45)
- # parinfer (28)
- # pedestal (1)
- # proton (23)
- # re-frame (18)
- # reagent (36)
- # ring (1)
- # ring-swagger (5)
- # untangled (13)
- # vim (9)
@andre i have in-frame re-frisk working nicely in a re-frame app, but the popup only shows the greeting, no data. any pointers?
@mikethompson Any plans to for more documentation on re-frame subscriptions please? The description on the main
README.md doesn't match the new coolness in 0.8.0 as described in the
CHANGES.md, and the commentary in the suggested todomvc file https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/subs.cljs isn't enough (for me at least). Something in the style of the new docs at https://github.com/Day8/re-frame/tree/master/docs would be great.
In particular, suppose one has a bunch of pre-0.8.0 subscriptions, that now all use the new
reg-sub-raw; and they all wrap their return value in
(reaction...). If one now uses the 0.8.0
reg-sub that does not return a ratom, is that generally ok? Does
reg-sub automatically wrap the computation like before, watching the inputs for changes? But/and if
reg-sub returns a regular value, then how do potential further nodes in the signal graph know when to update? etc etc.
@limist: I definitely think there needs to be some more documentation on subs, if nobody else tackles it before me then I will probably start working on them over the next few weeks.
Another question: I'd like to have an interceptor that, once activated/registered somehow, is added to all event handlers in my application, without explicitly modifying those event handlers individually. e.g. imagine something like the
debug interceptor but it only needs to be specified somewhere once, to start working app-wide (instead of tweaking a ton of individual event handlers). Is there a way to do that please?
@limist: I've not done this myself, but I believe that in the past the suggestion was to write your own wrapper function and use that instead of
reg-event-db. If it doesn't work well for you it might be worth checking with @mikethompson once he's on to see if there's a better method.
So something along the lines of
Though that code hasn't been tested at all, so there might be some issues with it.
(defn reg-my-event-db [id db-handler] (re-frame/reg-event-db id my-interceptors db-handler))
@shaun-mahood Yes thanks, saw that approach in the docs at https://github.com/Day8/re-frame/blob/master/docs/Interceptors.md#wrapping-handlers I'm hoping there's a way to auto-inject an interceptor in all events without touching individual handlers, so it's easier to turn on/off some universal behavior, app-wide.
@limist: You can still turn on or off universal behavior from your function later on (or have your function do it contextually if that makes sense), but I'm not sure of a way that prevents having to touch the handlers at least once without wrapping or overriding the
reg-event-db and similar functions.
@limist I've gone with the wrapping approach, and it worked very well. I can turn on/off the universal behaviour from the wrapper function. Changing all the handlers to the new one didn't take too long.
@curlyfry Thanks for the tip, I'm willing to do it, it just seems so...heavy-handed. 🙂 Especially when there must already be some built-in way to add extra interceptors on any/every event handler.