Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/humble-pears-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect-app/vue-components": patch
---

fix: ensure watch callbacks return undefined for consistency
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ watch(
},
(newTag) => {
currentTag.value = newTag ?? null
return undefined
},
{ immediate: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ watch(() => props.state, (newTag, oldTag) => {
props.field.validate("change")
}, 0)
}
return undefined
}, { immediate: true })
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,7 @@ export const useOmegaForm = <
// Reset with current values to mark them as the new baseline
form.reset(values.value)
}
return undefined
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ const Key = Symbol("injected") as InjectionKey<Map<string, { label: string; id:

export const useRegisterField = (field: ComputedRef<{ name: string; label: string; id: string }>) => {
const map = injectCertain(Key)
watch(field, (f) => map.set(f.name, { label: f.label, id: f.id }), { immediate: true })
watch(field, (f) => {
map.set(f.name, { label: f.label, id: f.id })
}, { immediate: true })
onUnmounted(() => map.delete(field.value.name)) // todo; perhap only when owned
}

Expand Down