This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-24
Channels
- # aws (7)
- # aws-lambda (3)
- # beginners (65)
- # boot (43)
- # cider (7)
- # cljs-dev (12)
- # cljsrn (15)
- # clojure (284)
- # clojure-austin (32)
- # clojure-brasil (4)
- # clojure-dusseldorf (4)
- # clojure-germany (1)
- # clojure-italy (40)
- # clojure-spec (21)
- # clojure-uk (69)
- # clojurescript (97)
- # core-async (11)
- # cursive (19)
- # data-science (1)
- # datascript (6)
- # datomic (30)
- # dirac (2)
- # emacs (4)
- # events (2)
- # fulcro (76)
- # graphql (38)
- # juxt (1)
- # lein-figwheel (1)
- # leiningen (6)
- # luminus (4)
- # lumo (13)
- # mount (4)
- # off-topic (24)
- # om (28)
- # onyx (32)
- # other-languages (1)
- # parinfer (40)
- # pedestal (1)
- # portkey (47)
- # re-frame (21)
- # reagent (4)
- # ring (4)
- # ring-swagger (3)
- # rum (1)
- # shadow-cljs (115)
- # spacemacs (5)
- # sql (14)
- # unrepl (1)
- # yada (3)
aw @nberger this would be useful, I implemented my own versions of reg-event-db and reg-event-fx to do error handling, which is ok but doesn't catch errors thrown in interceptors , Your version looks much better!
I’m not 100% satisfied with my answer here: https://stackoverflow.com/questions/46895879/re-run-subscription-on-input-change/46904084#46904084
but somehow I can’t get it to work without r/track!
. Looking forward to improvements.
"share some some hard-won lessons for how to build and maintain real world re-frame apps"
Does anyone know if there is an emacs mode for re-frame ? I would like to navigate to event and subscription definition the way it can be done with functions in cider but I can't find anything. Does it exist ? Anybody started something ?
I haven't started anything, although I've got a sort-reframe function that sorts all the handlers in alphabetical order
jump to definition sounds doable
a regexp would do it
If you use emacs you just need to connect to the repl and and run cljs-repl from figwheel. Can look details if you want, it works just like in clojure
(defun sort-reframe ()
(interactive)
(let ((p (point)))
(beginning-of-buffer)
(search-forward "(reg-")
(sort-subr nil
;; nextrecfun
(lambda ()
(when (not (search-forward "(reg-" nil t))
(end-of-buffer)))
;;endrecfun
(lambda ()
(up-list))
;; startkey-fun
(lambda ()
(search-forward ":" nil t)
nil)
;; end-key-fun
(lambda ()
(clojure-forward-logical-sexp))
;;predicate
(lambda (a b)
(let ((s1 (s-replace "." "/" (buffer-substring (car a) (cdr a))))
(s2 (s-replace "." "/" (buffer-substring (car b) (cdr b)))))
(string< s1 s2))))
(goto-char p)))
^ HORRIBLE I know but useful for me 😄 because I keep all my handlers in one big fileThanks for sharing, our app is way too big though there is no way we put all events in one file :D
@yenda this looks like it might be useful https://github.com/jacktasia/dumb-jump
Interesting. I wonder how well this would work for jumping to subscription/event handler definitions via the keyword.