pmndrs / valtio

💊 Valtio makes proxy-state simple for React and Vanilla
http://valtio.pmnd.rs
MIT License
8.66k stars 241 forks source link

feat: Support promise in watch util #825

Closed LiamMartens closed 7 months ago

LiamMartens commented 7 months ago

Related Issues or Discussions

https://github.com/pmndrs/valtio/issues/507

Summary

Updates the watch util to support a promise callback. Proxies are subscribed to immediately to improve the time to first callback. This way a proxy can be subscribed to before the promise finishes fully.

Check List

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
valtio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2023 0:52am
codesandbox-ci[bot] commented 7 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 554fc73243a9af9b93f73a70d989b09bc95b8036:

Sandbox Source
React Configuration
React TypeScript Configuration
React Browserify Configuration
React Snowpack Configuration
React Parcel Configuration
dai-shi commented 7 months ago

Thanks for working on it. Been busy, but hopefully, I'll be able to take a look sometime soon.