@pontem/liquidswap-widget
Version:
Liquidswap widget as custom web component
19 lines (15 loc) • 342 B
text/typescript
import { computed, getCurrentInstance } from 'vue';
export function createSyncRef(key: string) {
const instance = getCurrentInstance();
if (!instance) {
return undefined as any;
}
return computed({
get() {
return instance.props[key];
},
set(v) {
return instance.emit(`update:${key}`, v);
},
});
}