This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-02
Channels
- # aleph (6)
- # beginners (37)
- # boot (415)
- # cider (17)
- # cljs-dev (79)
- # cljsjs (3)
- # cljsrn (18)
- # clojars (3)
- # clojure (34)
- # clojure-france (6)
- # clojure-italy (1)
- # clojure-korea (1)
- # clojure-russia (22)
- # clojure-spec (64)
- # clojure-uk (47)
- # clojurebridge (6)
- # clojurescript (61)
- # clojurex (1)
- # cloverage (11)
- # component (6)
- # cursive (73)
- # data-science (6)
- # datascript (4)
- # datomic (38)
- # editors (1)
- # emacs (4)
- # events (16)
- # funcool (5)
- # garden (3)
- # hoplon (17)
- # jobs (2)
- # klipse (74)
- # off-topic (3)
- # om (81)
- # onyx (35)
- # parinfer (4)
- # pedestal (1)
- # perun (20)
- # planck (9)
- # proton (1)
- # re-frame (17)
- # reagent (3)
- # ring-swagger (1)
- # rum (7)
- # untangled (63)
- # vim (8)
How would I do a try/catch on the exception thrown by an event handler in an interceptor? In 0.6.0 we could just surround the call to the (handler)
with try.
@mikethompson Cool, thanks
@grant it is for dynamic subscriptions. See the docs folder
@joshkh it sounds like you want to create a reusable re-frame component. You want to use the "data table" in a new application.
@grant: I think https://github.com/Day8/re-frame/wiki/Dynamic-Subscriptions is the most recent documentation on dynamic subscriptions, it's a bit out of date but should explain it well enough.
@grant There is only one app-db
ever, so you'll want to "parameterize" the component, so that a new use of it works on a different path (new instance) within app-db
@grant so the trick is to parameterize the "subscriptions" and the "dispatches" with this path.
We use a technique we call dispatch-back
which is like a merge between a dispatch
+ callback
.
So the component (data table) would be given a parameter like xyz
(this is kinda like giving a callback to a component) and then the component will conj
xyz
onto whatever events is normally dispatch
es. The xyz
is assumed to uniquely identify the "instance" of the data table to be manipulated.
One of these days I'll get around to writing this stuff a bit more
Think about it this way ....
You'll notice that re-com
's reusable components all take (as arguments)
1. a "reactive source of data" (a ratom) and
2. a callbacks for updates
So one level up ... at the level of re-frame component ... you use the same architecture. Except the source of data will be a subsciption and the updates happen via a dispatch
rather than a callback. But those subscriptions and dispatches have to be paramaterized by xzy
.
@mikethompson: I would certainly be interested in seeing a basic example whenever you have time for it, seems like a useful pattern
@mikethompson Thanks for the info, I'll read the docs that @shaun-mahood mentioned and see if I can wrap my head around it.
(just saw the notification @mikethompson), Yup, that's exactly right. I want the re-frame based data table to be integrated into another project.