YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.

Home Page:https://syncedstore.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More concise Vue integration

texastoland opened this issue Β· comments

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 πŸ˜