Skip to content

Commit

Permalink
fix: skip setting values that are unchanged in useFetch (#552)
Browse files Browse the repository at this point in the history
Co-authored-by: wucancheng <wucancheng@forchange.tech>
  • Loading branch information
nbili and wucancheng committed Oct 11, 2021
1 parent 016ff0a commit 484b061
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/runtime/composables/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ const mergeDataOnMount = (data: Record<string, any>) => {
// Assign missing properties
if (key in vm) {
const _key = key as keyof typeof vm
// Skip value equal to incoming data
if (vm[_key] === data[key]) continue
// Skip functions (not stringifiable)
if (typeof vm[_key] === 'function') continue
// Preserve reactive objects
Expand Down

0 comments on commit 484b061

Please sign in to comment.