This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-09
Channels
- # adventofcode (93)
- # announcements (11)
- # babashka (7)
- # babashka-sci-dev (17)
- # beginners (73)
- # biff (7)
- # calva (3)
- # cider (1)
- # clj-kondo (160)
- # clj-together (12)
- # clojure (44)
- # clojure-art (2)
- # clojure-europe (12)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-norway (22)
- # clojure-uk (2)
- # clojurescript (8)
- # clr (1)
- # cursive (6)
- # data-science (1)
- # datomic (1)
- # emacs (6)
- # events (1)
- # exercism (1)
- # fulcro (6)
- # graphql (2)
- # introduce-yourself (1)
- # lsp (18)
- # nrepl (7)
- # off-topic (45)
- # polylith (25)
- # portal (25)
- # practicalli (3)
- # re-frame (14)
- # reagent (28)
- # reitit (2)
- # releases (2)
- # shadow-cljs (73)
- # sql (11)
- # tools-deps (12)
- # transit (4)
- # xtdb (4)
How do you manage data flow that linked to routes (I use reitit but it is not important)?
For example we have a simple todo mvc app with filters: active, done, all
And you have related routes for filters: /filter?key=active /filter?key=done etc
In which place you will manage that data (active filter)?
Dispatch re-frame event at router change (reitit view controller e.g.)?
Re-frame interceptor for navigate
event? Or somehow else?
Please avoid cross-posting. Since your Q in #C03S1L9DN doesn't have any answers and the Q is more appropriate in this channel, I'd remove that post and leave this one here. As to the actual question, it doesn't matter at all. I often use kee-frame, and it dispatches events from its own controllers. But if I didn't use it, I'd go with my current mood. :)
anyway I think there are many solutions about this, some of them more useful, more effective so I wanted to see them from other clojurians 🙂 Because when you just start to deep into new technology/stack you dont know how to do it properly
Yeah, I get that. But it's re-frame-specific, and people generally prefer not to see posts about technologies that they know nothing about in a general channel while there's also a specific channel.
Is it ok to return lazy sequences from subscriptions, without realizing them fully with something like doall
? I vaguely recall some bug related to this from years ago, but maybe my mind is playing tricks on me. And yes, I should just test this out but I'm lazy. Just like my datastructures.
I don't recall for sure whether Reagent uses identical?
or =
or something else for comparison of a ratom's states.
If it's =
, then you have a problem with even simple cases such as (= (range) (range))
.
it's =
, it was identical?
pre 0.6.0
> Reactions now only trigger updates of dependent components if their value change, as reported by =
(previously, identical?
was used).
I'm almost certain I found a bug in some re-frame app years ago where the problem was somehow related to the fact that just the first chunk of the seq was evaluated. So everything seemed to work ok, but as the seq size increased parts of the subscription graph (or perhaps the UI) did not update accordingly. But again, I might just be remembering things incorrectly
I know you can get into trouble in views with lazy seqs, if you don't realize them. Perhaps I'm just thinking about that.
http://timothypratley.blogspot.com/2017/01/reagent-deep-dive-part-3-sequences.html -> Example W: A button that does not work due to lazy deref