Content
@
https://warpcast.com/~/channel/react
0 reply
0 recast
0 reaction
Darryl Yeo đ ïž
@darrylyeo
Now this is a React state manager I can get behind. Just do property assignments and let the underlying JavaScript `Proxy` objects take care of the rest. No ugly `useState()` or `setVariableName()` functions in sight. (Notice how you can bypass the React Hooks runtime entirely by `subscribe()`-ing to changes.)
4 replies
0 recast
8 reactions
Barbs
@bbq
what are the benefits of this approach? it looks like a bunch of boilerplate for the same outcome as a usestate - is there something about the proxy pattern that is preferable, genuine Q
1 reply
0 recast
1 reaction
Darryl Yeo đ ïž
@darrylyeo
I think you'd use this for cases where you need state to live outside of the React runtime (perhaps a highly dynamic application with a React microfrontend), or you aren't in a position to choose a React alternative but want the ergonomic benefits of simple JavaScript assignment and implicit dependency tracking like Svelte.
0 reply
0 recast
1 reaction