This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-26
Channels
- # adventofcode (12)
- # beginners (141)
- # cider (3)
- # cljsrn (3)
- # clojure (76)
- # clojure-russia (1)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (15)
- # css (1)
- # duct (3)
- # emacs (5)
- # fulcro (85)
- # keechma (1)
- # leiningen (44)
- # off-topic (29)
- # om (6)
- # parinfer (4)
- # perun (1)
- # re-frame (18)
- # reagent (2)
- # ring-swagger (8)
- # shadow-cljs (5)
- # spacemacs (1)
- # sql (7)
Could you provide a use case when you would want this? I can't think of an instance where a nested subscription hasn't solved this type of issue https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/subs.cljs#L39 https://github.com/Day8/re-frame/blob/master/docs/SubscriptionInfographic.md
Is there some way to do multi-cast events with re-frame ? for instance i have this :window/resized event, that needs to do have an effect outside any view... actually resizing a phaser webgl context. I undersstand that i could add within my :window/resized reg-event-fx somethign like this : {:db newdb :phaser/resize new-size} ... but it feels sloppy, i want to separate concerns and really my window namespace shouldn't know about phaser, but rather the other way around
> that needs to do have an effect outside any view. Sounds like you want to define an effect handler! https://github.com/Day8/re-frame/blob/master/docs/Effects.md#extensible-side-effects
This is indeed what I've been doing. but I'd like to find a way to sort of reverse the order of concerns. It feels wrong that my window namespace has to know all its "callers" rather than the opposite
I personally don't see the issue though, since updating the phaser context is a direct effect of resizing the window 🙂
that window namespace is now coupled to this particular project .. what if I want to reuse it ?
then again i might be agonizing over nothing ... at some point one needs to do project specific things
I totally see where you're coming from. I haven't really seen event handlers as reusable in different projects (for some reason they seem to end up quite specific), but fx-handlers (and reagent components) end up more general and reusable.