This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-31
Channels
- # aleph (1)
- # announcements (2)
- # beginners (105)
- # braveandtrue (1)
- # cider (61)
- # clara (47)
- # cljdoc (29)
- # cljs-dev (5)
- # clojure (61)
- # clojure-austin (14)
- # clojure-brasil (1)
- # clojure-india (3)
- # clojure-italy (4)
- # clojure-mexico (1)
- # clojure-nl (2)
- # clojure-spec (37)
- # clojure-uk (95)
- # clojurescript (73)
- # cursive (12)
- # data-science (1)
- # datomic (26)
- # duct (10)
- # emacs (5)
- # fulcro (47)
- # hoplon (6)
- # hyperfiddle (3)
- # jobs-discuss (3)
- # kaocha (2)
- # leiningen (3)
- # nrepl (8)
- # off-topic (3)
- # onyx (2)
- # re-frame (31)
- # reitit (16)
- # shadow-cljs (36)
- # spacemacs (46)
- # specter (16)
- # tools-deps (13)
- # yada (22)
Hello guys
is it okay for call one dispatcher from another dispatcher then get the db updated then use it ?
@abdullahibra A code sample would probably help here 🙂
@ingesol it's fixed by passing a tag to the dispatcher
Is it possible and advisable to use subscriptions outside the context of a view? to say, react to some data being updated?
you can use track
function for that: https://reagent-project.github.io/news/news060-alpha.html
pros and cons of using re-frame-simple?
@drewverlee > Is it possible and advisable to use subscriptions outside the context of a view? to say, react to some data being updated? don’t think its a good idea
and if it isn’t happening during reagent render, you’d not get automatic watchers registered I believe
but there probably are alternative ways to do what you want, just not sure the specifics enough
well, im basically trying to use it like a subscription. Sometimes it feels easier to just point at the point of change, rather then all the places that could change it and all the ways it could be changed.
you might have a dozen hooks to a piece of state, but if u just want to be notified about when it changes, it seems odd to burden them all rather then right a post update hook to report the change. but if its not idiomatic, there are probably good reasons, even if im not sure i see them.
There are some interceptor approaches probably. And a few built in re-frame that perhaps you should consider
ah, are the subscription, reaction functions tied to the dom in some way?
your right, this should be a interceptor. which im not sure i can do easily either. my last hope then, just be explicit 🙂
They aren’t tied to dom but reagent wraps a “context” around render and that’s how subscriptions (reagent reactions really) are registered as watchers which makes them reactive.
seems to be very reframey to me? stop the click propagation and put it into reframe events
I was thinking to make a special dispatch that dispatched the event then called stopPropagation, but I don’t know if that is just hiding what is going on.
I wouldn't worry to much about it, it's basically an artifact of the underlying JS.
From a different perspective, you could say that calling stopPropagation
in your event handler is actually preventing side effects.
but any way you look at it, your event handler is wrapping the underlying JS event model, so it's never going to be perfectly pure.