Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[VUEXFIRE_SET_VALUE] (state, { path, target, data }) {
walkSet(target, path, data)
// state[key] = record
},
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
})
}
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
}
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
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>>
}
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>>
}
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>>
}
}
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,
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,
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,