This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-21
Channels
- # aws (2)
- # bangalore-clj (1)
- # beginners (25)
- # boot (2)
- # cider (176)
- # clara (73)
- # cljs-dev (6)
- # cljsrn (31)
- # clojure (40)
- # clojure-greece (9)
- # clojure-india (1)
- # clojure-italy (14)
- # clojure-nl (9)
- # clojure-russia (4)
- # clojure-uk (156)
- # clojurescript (124)
- # core-async (37)
- # cursive (2)
- # data-science (2)
- # datomic (22)
- # emacs (3)
- # fulcro (32)
- # graphql (6)
- # java (3)
- # lein-figwheel (19)
- # lumo (29)
- # nyc (1)
- # off-topic (9)
- # onyx (15)
- # portkey (12)
- # precept (2)
- # re-frame (15)
- # reagent (10)
- # rum (7)
- # schema (2)
- # shadow-cljs (48)
- # tools-deps (35)
- # yada (1)
I am running into this error:
clojure.lang.ExceptionInfo: re-frame: router state transition not found. :scheduled :finish-run {:fsm-state :scheduled, :trigger :finish-run}
I am trying to run sth like
(doseq [i (range 1 10000)]
(rf/dispatch [:test i]))
Note that I am running this in clojure and not clojurescript.@mikethompson The "triangles not working" problem happened to me again just now. Clearing Application's Local Storage and refreshing was enough to fix the problem.
I'm not sure exactly what triggered the problem, but here are some clues: 1) Like last week, it came together with the error of js/window.open returning null 2) This happened when I restarted the app after several days away. So, possibly, it was caused by one of: a) sitting idle for a while (three days) and/or b) forcibly closing and then restarting the cider buffers in emacs c) and/or opening a new browser tab for the app
thought I’d ask here as well.
I’m getting a circular dependency error and cannot figure out how to solve it. so I have
routes.cljs
(:require [app.events :as events]) ;; importing events here
(defroute projects "/projects" []
(re-frame/dispatch [::events/set-active-page {:page :projects}]))
and I have
events.cljs
(:require [app.routes :as routes]) ;; importing the above file here
(re-frame/reg-event-db
::get-project-success
(fn [db [_ {project :data}]]
(-> db
(assoc-in [:loading :project] false)
(assoc :active-project project
:page-title (:title project)
:breadcrumb [{:label "Projects"
:path (routes/projects)} ;; and using it here
{:label (:title project)}]))))
@nenadalm recommended to use :app.events/set-active-page
in my routes.cljs
instead and to remove the import of events
module. This works, but I was wondering if there’s another way to deal with this?@mikethompson The problem has occurred twice more. I can't yet see a clear pattern, though it seems to only occur a while after the last time I looked at the window...
So I have an app-db with a set of students, and every student has a set of grades. When I delete a student, I'd like to ensure that that student's grades are deleted, too. What's the "correct" way to do that with re-frame? I could do something like this:
{:on-click #(do (re-frame/dispatch [:student/delete student])
(re-frame/dispatch [:student/delete-grades student]))}
But I'd like the callsite not to have to worry about deleting the grades. I could use a reg-event-fx
that uses dispatch-n
to dispatch the deleting events, but I'm only operating on the app-db, so that doesn't seem quite right, either.I thing you could {:dispatch-n [[:student/delete-grades student] [:student/delete student]])}
or on the event-fx of successfully deleted grades call a dispatch to the [:student/delete student]
That should work, but they'd then be effect handlers (fx) instead of event handlers (db). I was basically wondering whether there's something like :dispatch-n
for reg-event-db
.
@shakdwipeea can you file a bug report with as much info as you can please.
@bravilogy I'd look in "External Resources" in /doc
at the various existing apps to see how they do it.
@deg thanks for trying to track this down @danielcompton ^^^
@flowthing avoid the temptation to think of a dispatch
like you would a function call. A dispatch
should happen in response to an event. I think you need to write a function called remove-student
which knows what the two steps are. Then call than from the event
handler.
@mikethompson Right, that makes sense. I'll do that. Thanks!
Hmm... my app-db/interceptor setup complicates the matter somewhat. I currently have things set up so that for every db event, only the updated branch of the app-db is validated against specs and stored in local storage. But this operation updates two branches (`:students` and :grades
), so it won't work. I think I'll need to adjust things so that validation and local storage updates always happen for the entire app-db.
@deg do you have the external window open, or the main panel?