pmndrs / valtio

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

fix: invalidate snap cache when property is removed from object #736

Closed Juyeong-Byeon closed 8 months ago

Juyeong-Byeon commented 1 year ago

Related Issues or Discussions

related to
https://github.com/pmndrs/valtio/issues/712

Just like that change [1], I suggest removing snap cache when props are removed from the parent object or array

[1] This change is removing the listeners for removed props from the parent object or array.

FYI: #712 is an issue that has occurred since version 1.8.0 caused by https://github.com/pmndrs/valtio/commit/ec445576274f6b1c53c86099846592b5550e24fd or https://github.com/pmndrs/valtio/pull/599

Fixes #712

Summary

Adding remove snap cache logic to deleteProperty function

Check List

vercel[bot] commented 1 year 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 Jun 10, 2023 2:38pm
codesandbox-ci[bot] commented 1 year 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 5e7403cff1ac62383e49464773d1dacc7083ab49:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
React Parcel Configuration
dai-shi commented 8 months ago

Closing as inactive. Let's reopen when there's a progress.