Skip to content

Commit

Permalink
fix: dedupe sync patch
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 4, 2023
1 parent 659966e commit 51ad6d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/client/state/syncState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export function createSyncState<State extends object>(serverState: State, defaul
}

function patch<K extends keyof State>(key: K, value: State[K]) {
if (state[key] === value)
return
clearTimeout(patchingTimeout)
patching = true
state[key] = value
Expand Down

0 comments on commit 51ad6d1

Please sign in to comment.