Skip to content

refactor(store): remove partial slice state updates#296

Merged
mihar-22 merged 1 commit intomainfrom
store-remove-partial-update
Jan 6, 2026
Merged

refactor(store): remove partial slice state updates#296
mihar-22 merged 1 commit intomainfrom
store-remove-partial-update

Conversation

@mihar-22
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 commented Jan 6, 2026

Remove the (state: Partial<State>) overload from slice update callback.

Previously, slices could call update({ key: value }) to patch state directly, bypassing getSnapshot. This created two code paths for state derivation and risked inconsistent derived state.

Now update() always syncs via getSnapshot, ensuring a single source of truth. The store's State.patch() already detects changed keys and only notifies relevant subscribers, so efficiency is maintained.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
vjs-10-demo-html Ready Ready Preview, Comment Jan 6, 2026 3:21am
vjs-10-demo-next Ready Ready Preview, Comment Jan 6, 2026 3:21am
vjs-10-demo-react Ready Ready Preview, Comment Jan 6, 2026 3:21am
1 Skipped Deployment
Project Deployment Review Updated (UTC)
vjs-10-website Skipped Skipped Jan 6, 2026 3:21am

@mihar-22 mihar-22 changed the title refactor(store): remove partial state bypass from slice update refactor(store): remove partial slice state updates Jan 6, 2026
@mihar-22 mihar-22 merged commit bb2b54e into main Jan 6, 2026
7 checks passed
@mihar-22 mihar-22 deleted the store-remove-partial-update branch January 6, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant