More concise Vue integration
texastoland opened this issue Β· comments
Texas Toland commented
I was just reading your Vue bindings! Maybe they could be simplified by manually triggering a ref without the reactive
proxy π
export function enableVueBindings({ shallowRef, triggerRef }) { // Vue namespace
customCreateAtom = (name, onBecomeObserved) => {
onBecomeObserved?.()
const ref = shallowRef()
return {
reportObserved: () => ref.value // read
reportChanged: () => triggerRef(ref) // write
};
};
customReaction = undefined // automatic in Vue
}
Totally untested π