How to use the @posva/vuefire-core.rtdbBindAsObject function in @posva/vuefire-core

To help you get started, we’ve selected a few @posva/vuefire-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuejs / vuefire / packages / vuexfire / src / rtdb.ts View on Github external
return new Promise((resolve, reject) => {
    sub[key] = Array.isArray(state[key])
      ? rtdbBindAsArray(
          {
            vm: state,
            key,
            collection: ref,
            ops,
            resolve,
            reject,
          },
          options
        )
      : rtdbBindAsObject(
          {
            vm: state,
            key,
            document: ref,
            ops,
            resolve,
            reject,
          },
          options
        )
  })
}
github vuejs / vuefire / packages / vuefire / src / rtdb.ts View on Github external
return new Promise((resolve, reject) => {
    let unbind
    if (Array.isArray(vm[key])) {
      unbind = bindAsArray(
        {
          vm,
          key,
          collection: source,
          resolve,
          reject,
          ops,
        },
        options
      )
    } else {
      unbind = bindAsObject(
        {
          vm,
          key,
          document: source,
          resolve,
          reject,
          ops,
        },
        options
      )
    }
    vm._firebaseUnbinds[key] = unbind
  })
}