This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-16
Channels
- # announcements (3)
- # beginners (104)
- # boot (18)
- # calva (1)
- # cider (43)
- # cljs-dev (45)
- # cljsrn (2)
- # clojure (29)
- # clojure-dev (10)
- # clojure-europe (2)
- # clojure-italy (117)
- # clojure-nl (17)
- # clojure-spec (56)
- # clojure-uk (41)
- # clojuredesign-podcast (12)
- # clojurescript (35)
- # community-development (6)
- # cursive (27)
- # datomic (12)
- # emacs (9)
- # fulcro (6)
- # graalvm (52)
- # instaparse (6)
- # klipse (3)
- # leiningen (11)
- # lumo (1)
- # off-topic (16)
- # pathom (31)
- # re-frame (10)
- # reagent (26)
- # reitit (3)
- # shadow-cljs (67)
- # sql (4)
- # tools-deps (1)
@stefan.age there’s also https://github.com/Day8/re-frame-async-flow-fx, which I’m finding to be a nice sharp tool if you need explicit ordering.
the docs talk a lot about using it for app startup, but it’s handy for converting other this-before-thats into data
I’m probably doing something wrong with dispatch-n because the 2nd event is still dispatching with the previous state value even though it subscribes to a piece of state that the first event should be changing
I’m really wild guessing, but if you are using an interceptor you need to return {:db db} in your event or you lose all the interceptor updates..
I still think chaining the dispatches (event A dispatches B which dispatches C and so on) is the safest way to guarantee ordering. From my memories of reading the re-frame-async-flow-fx docs, it has a significant performance overhead, which is why you use halt? true
to clean up its sniffers when you're done using it to initialize your app.
it’s admittedly pretty verbose to chain events through handlers and subsequent dispatches, but the async-flow-fx abstraction isn’t a no-tradeoff solution
it also doesnt fit a lot of use cases very well (its mostly for single-use events like bootstrapping an app). i’ve seen codebases go from event chains -> some custom abstraction -> flow-fx -> back to event chains. iirc @mikethompson mentioned a while back that he’s been chewing on some solutions to this via state machines? not sure if that got anywhere