Skip to content

Commit

Permalink
refactor: use hasChanged for useModel comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 24, 2024
1 parent a18f1ec commit b5cad0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/runtime-core/src/helpers/useModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export function useModel(
// updates and there will be no prop sync. However the local input state
// may be out of sync, so we need to force an update here.
if (
value !== emittedValue &&
value !== prevSetValue &&
emittedValue === prevEmittedValue
hasChanged(value, emittedValue) &&
hasChanged(value, prevSetValue) &&
!hasChanged(emittedValue, prevEmittedValue)
) {
trigger()
}
Expand Down

0 comments on commit b5cad0e

Please sign in to comment.