This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-29
Channels
- # aleph (3)
- # announcements (16)
- # beginners (85)
- # calva (2)
- # cider (13)
- # clj-kondo (84)
- # cljdoc (3)
- # clojure (109)
- # clojure-belgium (1)
- # clojure-china (39)
- # clojure-europe (4)
- # clojure-france (1)
- # clojure-italy (70)
- # clojure-nl (8)
- # clojure-spec (8)
- # clojure-uk (53)
- # clojuredesign-podcast (14)
- # clojurescript (43)
- # cursive (25)
- # data-science (1)
- # datomic (4)
- # emacs (10)
- # figwheel (4)
- # garden (4)
- # graphql (5)
- # jackdaw (10)
- # jobs (5)
- # jobs-discuss (5)
- # lambdaisland (2)
- # leiningen (3)
- # luminus (7)
- # off-topic (32)
- # pathom (11)
- # pedestal (2)
- # planck (15)
- # re-frame (12)
- # reagent (4)
- # remote-jobs (2)
- # shadow-cljs (51)
- # sql (29)
- # tools-deps (47)
Came across some code that dispatches a re-frame event from a re-frame subscription handler. That feels kinda wrong to me, although I'm not sure I can put into words why. I guess I've always figured subscription handler functions oughta be pure, for one thing. Thoughts?
Yes, you are right, although the requirement does come up. Perhaps a clearer way of achieving the same thing would be to use https://github.com/vimsical/re-frame-utils/blob/master/src/vimsical/re_frame/fx/track.cljc
Sadly, https://github.com/vimsical/re-frame-utils/issues/5 prevents me from using that library in our project. Could fork it, maybe.
Or just copy paste :D I often do that with this kind of thing as you end up 'owning' it really
Yeah, that's one option. I can see myself using this in other projects down the line, though.
The code in subscription mentioned above shoud be probably moved into reg-fx
. The subscriptions are for extracting and computation of data before showing it to the user.
Right, but determining whether the event that is currently being dispatched from the subscription should be dispatched at all relies on multiple other subscriptions, and I don't think it's OK to use subscriptions in reg-fx
, either.
Hi, I made a simple app with re-frame. I don't need any security what is the fastest easiest way to persist app-db. Is there any library for sync'ing app-db with some real-db?
@m373h4n If you can use localStorage https://github.com/akiroz/re-frame-storage works well