Skip to content

Commit

Permalink
fix(valueSync): vue3 prevent recursive error when assigning a new `…
Browse files Browse the repository at this point in the history
…ref` to a list
  • Loading branch information
pikax committed Aug 31, 2020
1 parent e60fb32 commit 3350183
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vue-composable/src/state/valueSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export function useValueSync<T>(
([m, list]) => {
// value added set master
if (lastLen < list.length) {
list.forEach(x => (x.value = m));
list.forEach(x => {
if (x.value !== m) {
x.value = m;
}
});
return;
}
lastLen = list.length;
Expand Down

0 comments on commit 3350183

Please sign in to comment.