This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-22
Channels
- # announcements (9)
- # asami (52)
- # aws (1)
- # babashka (7)
- # babashka-sci-dev (12)
- # beginners (72)
- # calva (24)
- # cider (9)
- # clj-kondo (76)
- # cljs-dev (15)
- # clojure (19)
- # clojure-australia (4)
- # clojure-europe (33)
- # clojure-france (9)
- # clojure-gamedev (17)
- # clojure-nl (6)
- # clojure-portugal (5)
- # clojure-uk (5)
- # clojurescript (61)
- # clojureverse-ops (4)
- # code-reviews (23)
- # conjure (1)
- # data-science (2)
- # datalevin (6)
- # datomic (49)
- # gratitude (1)
- # helix (24)
- # holy-lambda (14)
- # jobs (3)
- # lsp (92)
- # malli (7)
- # missionary (8)
- # pathom (12)
- # proletarian (3)
- # re-frame (4)
- # remote-jobs (1)
- # shadow-cljs (4)
- # spacemacs (3)
- # sql (9)
- # tools-build (90)
- # vim (1)
- # xtdb (11)
Hi all, I’m doing a spike to determine what tech we want to use for our new SPA client. We are considering helix, so that’s what we’re using for our spike now. We like it a lot so far. A very important question that remains, on which I am hoping to get know your opinions, is what to use for global state management? We could use re-agent, but it appears that in that case most components have to be reagent components, which defeats the purpose of using Helix. We could use redux.js, maybe with a wrapper. What is your take on this?
I have been using react-query for all state management needs, with a couple of custom hooks that use the context for things like ui theme - no state management lib like redux/reframe needed. Works very well so far
But if you really want a reframe/clojury experience this looks pretty good https://github.com/orestis/reseda
That certainly looks interesting, never heard of it before, thanks for that pointer @alex395
@alex395 How well is reseda maintained? There are a few trivial pull requests open, so it gives the impression that it is not very well maintained?
Hi @stefan.van.den.oord. We use it in production, so in some sense it's suitable for production use 🙂
Ah right I see. If we are going to use this, I would actually offer to co-maintain for this kind of stuff if you like.
It does help with a lot of aspects, especially the whole "assoc a pending promise wrapped in a "suspending" in a hook or a global store or wherever, then React will suspend until it resolves".
In the coming months we'll have to be working more on the global store aspect of stuff and some things like optimistic updates so I'm not sure if new primitives will appear.
To clarify: reseda is two primitives that you can combine as needed. E.g. • First: a "store" that looks like redux if you squint, but for clojure data, backed by atoms • use that in a global var, and you have a global store. Put it in a React context, you have a scoped store. Stick it in a Ref and you have component-local state • Second: support for "Suspense for Data Fetching" where you use Suspense boundaries for async data.
The second primitive is completely orthogonal to the first, and it might see some more updates in the future.
For me it is mostly about the global state side of things. But what you said about suspense also sounds good.
as part of your spike, it might be good to lay out exactly what kinds of state you want to be global
you might find that there are purpose built solutions for those already in the JS community
for data fetching, you can use react-query. although, this is the one you probably want "native" CLJS support. I'm working on something for this slowly 🙂
