pmndrs/valtio ? reverse-engineered prompt
Reverse engineered prompt
Build me a small TypeScript state management library that makes proxy based state simple for both React and plain JavaScript.
I want to create a state object with a proxy helper, update it by mutating it directly anywhere in the app, and then read it in React with a hook that only re renders the parts of the UI that actually changed. It should also work outside React with subscriptions, so I can listen to changes on the whole state or on a specific property. Please include support for a few handy extras like keeping some objects untracked, reading async values in React 19 style, and a way to inspect or debug state changes with devtools.
Make it feel lightweight and easy to use, with a couple of simple examples and tests. If anything is unclear, look up the current docs online first and match the behavior closely.
Are you gonna build this?
make sure you review the code using coderabbit