pmndrs / valtio

🧙 Valtio makes proxy-state simple for React and Vanilla
https://valtio.dev
MIT License
8.84k stars 248 forks source link

allow `useProxy` to pass `useSnapshot` options #683

Closed steve-py96 closed 1 year ago

steve-py96 commented 1 year ago

Summary

useProxy only takes the store yet as argument, in case of input-elements a sync pass-through would also be required (ref https://github.com/pmndrs/valtio/#update-synchronously)

Link to reproduction

https://stackblitz.com/edit/vitejs-vite-6d3nla?file=src%2FApp.jsx&terminal=dev

Check List

Please do not ask questions in issues.

Please include a minimal reproduction.

dai-shi commented 1 year ago

Great point. Would you like to open a PR? Use Parameters<typeof useSnapshot>[1] to get options type.

steve-py96 commented 1 year ago

Will gladly do 👍🏿