Fork me on GitHub

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


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?


@orestis That’s your library right? Do you consider it suitable for production use?


Hi @stefan.van.den.oord. We use it in production, so in some sense it's suitable for production use 🙂


Those trivial pull requests come from dependabot and are just noise


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.


Yeah it seems like a useful library. I’ll include it in my spike today or Monday.


For me it is mostly about the global state side of things. But what you said about suspense also sounds good.


Let me know if you need any more guidance or if you have any feedback on the docs 🙂


Will do, thanks!


as part of your spike, it might be good to lay out exactly what kinds of state you want to be global

👍 1

you might find that there are purpose built solutions for those already in the JS community


i.e. for navigation, use react-router. for theming, use a CSS-in-JS lib


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 🙂

clojure-spin 2

reseda seems like a great catch all rn, although i havent used it yet


@orestis still trying to transfer ownership of hx to you. you'll need to delete your fork to do so 😄


Oh I need to merge a PR that points to it :) I will do so next week and bother you again

thanks2 1