How to use @posva/vuefire-core - 10 common examples

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 / common / mutations.js View on Github external
[VUEXFIRE_SET_VALUE] (state, { path, target, data }) {
    walkSet(target, path, data)
    // state[key] = record
  },
github vuejs / vuefire / packages / vuefire / src / firestore.ts View on Github external
vm._firestoreUnbinds[key] = unbind
  })
}

interface PluginOptions {
  bindName?: string
  unbindName?: string
  serialize?: FirestoreOptions['serialize']
  reset?: FirestoreOptions['reset']
  wait?: FirestoreOptions['wait']
}

const defaultOptions: Readonly> = {
  bindName: '$bind',
  unbindName: '$unbind',
  serialize: firestoreOptions.serialize,
  reset: firestoreOptions.reset,
  wait: firestoreOptions.wait,
}

declare module 'vue/types/vue' {
  // TODO: export types to allow custom function names
  interface Vue {
    $bind(
      name: string,
      reference: firestore.Query | firestore.CollectionReference,
      options?: FirestoreOptions
    ): Promise
    $bind(
      name: string,
      reference: firestore.DocumentReference,
      options?: FirestoreOptions
github vuejs / vuefire / packages / vuefire / src / firestore.ts View on Github external
})
}

interface PluginOptions {
  bindName?: string
  unbindName?: string
  serialize?: FirestoreOptions['serialize']
  reset?: FirestoreOptions['reset']
  wait?: FirestoreOptions['wait']
}

const defaultOptions: Readonly> = {
  bindName: '$bind',
  unbindName: '$unbind',
  serialize: firestoreOptions.serialize,
  reset: firestoreOptions.reset,
  wait: firestoreOptions.wait,
}

declare module 'vue/types/vue' {
  // TODO: export types to allow custom function names
  interface Vue {
    $bind(
      name: string,
      reference: firestore.Query | firestore.CollectionReference,
      options?: FirestoreOptions
    ): Promise
    $bind(
      name: string,
      reference: firestore.DocumentReference,
      options?: FirestoreOptions
    ): Promise
github vuejs / vuefire / packages / vuefire / src / firestore.ts View on Github external
}

interface PluginOptions {
  bindName?: string
  unbindName?: string
  serialize?: FirestoreOptions['serialize']
  reset?: FirestoreOptions['reset']
  wait?: FirestoreOptions['wait']
}

const defaultOptions: Readonly> = {
  bindName: '$bind',
  unbindName: '$unbind',
  serialize: firestoreOptions.serialize,
  reset: firestoreOptions.reset,
  wait: firestoreOptions.wait,
}

declare module 'vue/types/vue' {
  // TODO: export types to allow custom function names
  interface Vue {
    $bind(
      name: string,
      reference: firestore.Query | firestore.CollectionReference,
      options?: FirestoreOptions
    ): Promise
    $bind(
      name: string,
      reference: firestore.DocumentReference,
      options?: FirestoreOptions
    ): Promise
    $unbind: (name: string, reset?: FirestoreOptions['reset']) => void
github vuejs / vuefire / packages / vuefire / src / rtdb.ts View on Github external
delete vm._firebaseUnbinds[key]
}

interface PluginOptions {
  bindName?: string
  unbindName?: string
  serialize?: RTDBOptions['serialize']
  reset?: RTDBOptions['reset']
  wait?: RTDBOptions['wait']
}

const defaultOptions: Readonly> = {
  bindName: '$rtdbBind',
  unbindName: '$rtdbUnbind',
  serialize: rtdbOptions.serialize,
  reset: rtdbOptions.reset,
  wait: rtdbOptions.wait,
}

declare module 'vue/types/vue' {
  // TODO: export types to allow custom function names
  interface Vue {
    $rtdbBind(
      name: string,
      reference: database.Reference | database.Query,
      options?: RTDBOptions
    ): Promise
    $rtdbUnbind: (name: string, reset?: RTDBOptions['reset']) => void
    $firebaseRefs: Readonly>
    _firebaseSources: Readonly>
    _firebaseUnbinds: Readonly>>
  }
github vuejs / vuefire / packages / vuefire / src / rtdb.ts View on Github external
delete vm._firebaseSources[key]
  delete vm._firebaseUnbinds[key]
}

interface PluginOptions {
  bindName?: string
  unbindName?: string
  serialize?: RTDBOptions['serialize']
  reset?: RTDBOptions['reset']
  wait?: RTDBOptions['wait']
}

const defaultOptions: Readonly> = {
  bindName: '$rtdbBind',
  unbindName: '$rtdbUnbind',
  serialize: rtdbOptions.serialize,
  reset: rtdbOptions.reset,
  wait: rtdbOptions.wait,
}

declare module 'vue/types/vue' {
  // TODO: export types to allow custom function names
  interface Vue {
    $rtdbBind(
      name: string,
      reference: database.Reference | database.Query,
      options?: RTDBOptions
    ): Promise
    $rtdbUnbind: (name: string, reset?: RTDBOptions['reset']) => void
    $firebaseRefs: Readonly>
    _firebaseSources: Readonly>
    _firebaseUnbinds: Readonly>>
github vuejs / vuefire / packages / vuefire / src / rtdb.ts View on Github external
}

interface PluginOptions {
  bindName?: string
  unbindName?: string
  serialize?: RTDBOptions['serialize']
  reset?: RTDBOptions['reset']
  wait?: RTDBOptions['wait']
}

const defaultOptions: Readonly> = {
  bindName: '$rtdbBind',
  unbindName: '$rtdbUnbind',
  serialize: rtdbOptions.serialize,
  reset: rtdbOptions.reset,
  wait: rtdbOptions.wait,
}

declare module 'vue/types/vue' {
  // TODO: export types to allow custom function names
  interface Vue {
    $rtdbBind(
      name: string,
      reference: database.Reference | database.Query,
      options?: RTDBOptions
    ): Promise
    $rtdbUnbind: (name: string, reset?: RTDBOptions['reset']) => void
    $firebaseRefs: Readonly>
    _firebaseSources: Readonly>
    _firebaseUnbinds: Readonly>>
  }
}
github vuejs / vuefire / packages / vuefire / src / index.js View on Github external
return new Promise((resolve, reject) => {
    let unbind
    if (ref.where) {
      unbind = bindCollection(
        {
          vm,
          key,
          ops,
          collection: ref,
          resolve,
          reject,
        },
        options
      )
    } else {
      unbind = bindDocument(
        {
          vm,
          key,
          ops,
github vuejs / vuefire / packages / vuefire / src / firestore.ts View on Github external
return new Promise((resolve, reject) => {
    let unbind
    if ('where' in ref) {
      unbind = bindCollection(
        {
          vm,
          key,
          ops,
          collection: ref,
          resolve,
          reject,
        },
        options
      )
    } else {
      unbind = bindDocument(
        {
          vm,
          key,
          ops,
github vuejs / vuefire / packages / vuexfire / src / firestore.ts View on Github external
return new Promise((resolve, reject) => {
    sub[key] =
      'where' in ref
        ? bindCollection(
            {
              vm: state,
              key,
              collection: ref,
              ops,
              resolve,
              reject,
            },
            options
          )
        : bindDocument(
            {
              vm: state,
              key,
              document: ref,
              ops,