Files
manolia-alpha/node_modules/buetify/lib/composables/proxy/useProxy.js
Robin COuret e0e50af706 init component
2026-02-16 17:28:37 +01:00

26 lines
510 B
JavaScript
Executable File

import { shallowRef, watch, computed, unref } from 'vue';
export function useProxy(ref, onUpdate) {
const internalValue = shallowRef(ref.value);
watch(ref, newValue => {
internalValue.value = newValue;
});
const value = computed({
get() {
return internalValue.value;
},
set(val) {
internalValue.value = val;
const update = unref(onUpdate);
if (update) {
update(val);
}
}
});
return {
value
};
}
//# sourceMappingURL=useProxy.js.map