8000 feat(useRefHistory): add `shouldCommit` by JonathanSchndr · Pull Request #4471 · vueuse/vueuse · GitHub
[go: up one dir, main page]

Skip to content

feat(useRefHistory): add shouldCommit #4471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 10, 2025
Merged
Prev Previous commit
Update packages/core/useRefHistory/index.ts
Co-authored-by: Robin <robin.kehl@singular-it.de>
  • Loading branch information
JonathanSchndr and OrbisK authored Jun 10, 2025
commit 122e6cc64ae3d5e53005adfa0d719e54dc0dd265
6 changes: 2 additions & 4 deletions packages/core/useRefHistory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,8 @@ export function useRefHistory<Raw, Serialized = Raw>(
// so we do not trigger an extra commit in the async watcher
ignorePrevAsyncUpdates()

if (shouldCommit) {
if (!shouldCommit(lastRawValue, source.value))
return
}
if (!shouldCommit(lastRawValue, source.value))
return

lastRawValue = source.value
manualCommit()
Expand Down
0