This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-24
Channels
- # announcements (1)
- # beginners (113)
- # calva (16)
- # cider (6)
- # cljsrn (1)
- # clojure (104)
- # clojure-argentina (2)
- # clojure-dev (3)
- # clojure-italy (1)
- # clojure-nl (10)
- # clojure-spec (6)
- # clojure-uk (4)
- # clojuredesign-podcast (44)
- # clojurescript (25)
- # core-async (2)
- # datomic (21)
- # emacs (14)
- # events (1)
- # figwheel-main (12)
- # fulcro (7)
- # joker (2)
- # leiningen (1)
- # mount (7)
- # music (1)
- # off-topic (16)
- # pedestal (3)
- # re-frame (8)
- # reagent (8)
- # reitit (11)
- # shadow-cljs (4)
- # spacemacs (16)
- # sql (1)
- # tools-deps (14)
- # vim (1)
Newb Question: Could anyone point me to suggested reading on different ways of organizing a re-frame project once it reaches the point of not being able to have all subs in subs.clj
, all events in events.clj
, etc. I thought I remember reading something about it in the official re-frame docs but I can't seem to find the page. Thanks!
@mafcocinco https://github.com/Day8/re-frame/blob/master/docs/App-Structure.md#larger-apps
I'm very new to re-frame and I was wondering if there is a streight-forward way to setup an event which is composed of multiple asynchronous events with intermediate values which depend on each other? I tried out https://clojars.org/day8.re-frame/async-flow-fx but wiith this I'd have to compare the whole event vectors to ensure that I react only to the exact event which I issued (And not another same event with different arguments)
Some code for illustration:
(rf/reg-event-fx
:create-root
(fn [_ _]
{:async-flow {:first-dispatch [:do-get-board "root"]
:rules [{:when :seen? :events :fail-get-board
:dispatch [:create-board "root" nil]}]}})))
I want to check if a board already exists in the database - and only create it if it is not.
With this code, it could happen that another event is issued about at the same time and the fail-get-board
reacts to it instead of the [:do-get-board "root"]
eventI guess one solution to this particular problem would be to extend the pouchdb api with a create-if-not-exists
function but I was hoping to be able to rely on a small set of base-API functions and handle compositions on higher layers