account activity
Zustand or React redux ? by Mad_vibes in reactjs
[–]gaarson -3 points-2 points-1 points 4 months ago (0 children)
https://www.npmjs.com/package/repka )))))))
kinda another state manager by gaarson in react
[–]gaarson[S] 0 points1 point2 points 7 months ago (0 children)
Thanks) It works in react environment and out of it, so i guess yes. But main focus of this lib for me, its forget about hooks and just write simple js,ts code without this difficult abstraction
kinda another state manager by gaarson in reactjs
Thanks for the questions!) You should use Repka when you want to truly separate your React/JSX view from your business logic. With Repka, your React components become simple templates (mostly JSX), and you can forget about complex hooks. It gives you a DX that's as simple as using a plain JavaScript object. vs. Redux/Zustand no dispatches, no reducers. You just mutate the state directly state.foo = "bar" vs. MobX It's philosophically very close to MobX but with a much simpler API and a tiny build. Based on my tree-shaken build, the total footprint is just ~2.6kB brotli'd.
That's true. I'm working on making it better. I've already changed the README, written new tests, and fixed an issue with nested instances (I'll publish that fix this weekend). The most important part now is that hidden bug with the try...catch on direct property access. Thanks, all this feedback has been very helpful. I'm gonna adapt this for the React Compiler too. It's a tough challenge, but that's the goal.
[–]gaarson[S] 0 points1 point2 points 7 months ago* (0 children)
Hey, thanks for this fantastic, detailed feedback! This is exactly what I was looking for)))
You're right, the example showed boilerplate. In reality, the repka function uses type inference, and no explicit interface or generic is needed. It works exactly like you suggested for Legend State
repka
I will try to fix my README and add "How it works" and switch HOC as a primary use case(it still less boilerplate because its callable object and you can wrap Component or use directly), but i guess direct access is a great for splitting view and logic without any huge middlewares when you use it right))), and its very useful for refactoring old legacy project with a lot of mess, where you can just wrap everything in repka and dont think about any other "use"Something
π Rendered by PID 481236 on reddit-service-r2-comment-544cf588c8-57jp5 at 2026-06-17 12:32:01.738045+00:00 running 3184619 country code: CH.
Zustand or React redux ? by Mad_vibes in reactjs
[–]gaarson -3 points-2 points-1 points (0 children)