This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-25
Channels
- # announcements (4)
- # babashka (13)
- # beginners (115)
- # cider (62)
- # clj-kondo (16)
- # cljdoc (4)
- # cljs-dev (5)
- # clojure (44)
- # clojure-europe (57)
- # clojure-greece (1)
- # clojure-italy (2)
- # clojure-nl (3)
- # clojure-spec (2)
- # clojure-uk (24)
- # clojurescript (58)
- # code-reviews (2)
- # community-development (6)
- # conjure (3)
- # core-async (9)
- # cursive (34)
- # datahike (3)
- # datalog (1)
- # datomic (67)
- # emacs (9)
- # events (5)
- # fulcro (9)
- # graalvm (1)
- # jobs (1)
- # lsp (24)
- # off-topic (20)
- # pathom (17)
- # polylith (11)
- # re-frame (21)
- # react (21)
- # reagent (3)
- # reitit (23)
- # releases (1)
- # remote-jobs (1)
- # ring (3)
- # sci (47)
- # tools-deps (7)
- # vim (15)
- # xtdb (4)
Curious what kind of subscription layers people have been using. I’m looking for something that gets me a bunch of “views” on data that’s in one atom and efficiently updates those views if the underlying data changes. I wrote https://github.com/martinklepsch/derivatives once which kind of does this but there’s a few things I’d like to change about it so curious what other approaches are out there
do you mean this? https://www.npmjs.com/package/use-subscription
hah, I thank you, I have to realize I was very confused about the name of the thing I am talking about
@martinklepsch I’ve made reseda for this https://github.com/orestis/reseda
It’s tied to React and doesn’t do too much. Haven’t had the need yet to change anything.
@ashnur you can see the mutable source in action too but I gave up on it until React releases a stable version.
@orestis thanks for sharing, I found that - at least in our codebase - get-in
style subscriptions cause a lot of data transformations to happen in components. This makes them harder to use in REPLs and harder to test. So we’re looking for something that can create more complex derived data from multiple branches of the root atom
With resada it looks like that would only be possible with a selector function but then that function would be ran every time the root atom has sees any kind of changes.
Yes that’s true. Functions are in a way the lowest level in that they’re the most powerful flexible but hard to make guarantees.
It’s an interesting problem, how to cache results without running the code that produces the result? I guess intermediate steps might be a possibility, right? Cancel early. I’m curious about the domain you’re dealing with.
BTW reseda internationally deals with IWatchable so if your intermediate values implement the interface you can plug them into a reseda store to get the React updates for free.