Skip to content

Commit b5cad0e

Browse files
committed
refactor: use hasChanged for useModel comparisons
1 parent a18f1ec commit b5cad0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/runtime-core/src/helpers/useModel.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ export function useModel(
8181
// updates and there will be no prop sync. However the local input state
8282
// may be out of sync, so we need to force an update here.
8383
if (
84-
value !== emittedValue &&
85-
value !== prevSetValue &&
86-
emittedValue === prevEmittedValue
84+
hasChanged(value, emittedValue) &&
85+
hasChanged(value, prevSetValue) &&
86+
!hasChanged(emittedValue, prevEmittedValue)
8787
) {
8888
trigger()
8989
}

0 commit comments

Comments
 (0)