This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-30
Channels
- # adventofcode (95)
- # announcements (17)
- # babashka (28)
- # beginners (107)
- # calva (34)
- # clj-kondo (7)
- # cljs-dev (20)
- # cljsrn (1)
- # clojure (95)
- # clojure-europe (41)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (77)
- # cursive (7)
- # data-science (1)
- # datalog (4)
- # datomic (12)
- # events (3)
- # fulcro (32)
- # graalvm (2)
- # hugsql (19)
- # introduce-yourself (4)
- # jobs (2)
- # lsp (20)
- # membrane-term (19)
- # numerical-computing (1)
- # off-topic (8)
- # pathom (3)
- # polylith (17)
- # portal (42)
- # re-frame (7)
- # reagent (32)
- # remote-jobs (1)
- # shadow-cljs (86)
- # spacemacs (3)
- # tools-deps (52)
- # uncomplicate (1)
- # xtdb (23)
following up on that, are there any guides/blogs about converting an existing reagent project to use re-frame, vs starting from scratch?
At its core, the process is rather simple:
1. Find a ratom that you consider to be a part of your app's state
2. Figure out the path where you'd put its value in the re-frame's app-db
3. Create an event that sets the value at that path
4. Replace all instances of reset!
on that ratom with dispatch
to that event
5. Create a subscription that retrieves the value at that path
6. Replace all instances of derefing the ratom with derefing the subscription
7. For all cursors, tracks, reactions, create its own subscription that uses the original one as a signal
8. Put all side-effects inside effects and use them within new event handlers to which you dispatch in place where old side-effects were originally
There are some exceptions to the above, of course. Specifics highly depend on a particular case.
interesting, that makes sense
What are some common stragies for a client handling a long request to the backend that might time out, but you want to re-try. I'm thinking we could just piggy back on re-frames/dispatch later function.
like you want to retry after a timeout? Have an on-failure handler that checks the reason for the error and tries again
you could describe it as a statechart… https://lucywang000.github.io/clj-statecharts/docs/delayed/
> ike you want to retry after a timeout? Have an on-failure handler that checks the reason for the error and tries again This is what we ended up doing using dispatch-later