Skip to content

Commit 279d180

Browse files
committed
fix lint
1 parent bba7bbf commit 279d180

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

packages/@posva/vuefire-core/src/firestore/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function subscribeToDocument(
6161
options: Required<FirestoreOptions>
6262
) {
6363
const subs = Object.create(null)
64-
const unbind = ref.onSnapshot(snapshot => {
64+
const unbind = ref.onSnapshot((snapshot) => {
6565
if (snapshot.exists) {
6666
updateDataFromDocumentSnapshot(options, target, path, snapshot, subs, ops, depth, resolve)
6767
} else {
@@ -100,9 +100,9 @@ function subscribeToRefs(
100100
resolve: CommonBindOptionsParameter['resolve']
101101
) {
102102
const refKeys = Object.keys(refs)
103-
const missingKeys = Object.keys(subs).filter(refKey => refKeys.indexOf(refKey) < 0)
103+
const missingKeys = Object.keys(subs).filter((refKey) => refKeys.indexOf(refKey) < 0)
104104
// unbind keys that are no longer there
105-
missingKeys.forEach(refKey => {
105+
missingKeys.forEach((refKey) => {
106106
subs[refKey].unsub()
107107
delete subs[refKey]
108108
})
@@ -117,7 +117,7 @@ function subscribeToRefs(
117117
}
118118
}
119119

120-
refKeys.forEach(refKey => {
120+
refKeys.forEach((refKey) => {
121121
const sub = subs[refKey]
122122
const ref = refs[refKey]
123123
const docPath = `${path}.${refKey}`
@@ -203,7 +203,7 @@ export function bindCollection(
203203
},
204204
}
205205

206-
const unbind = collection.onSnapshot(snapshot => {
206+
const unbind = collection.onSnapshot((snapshot) => {
207207
// console.log('pending', metadata.hasPendingWrites)
208208
// docs.forEach(d => console.log('doc', d, '\n', 'data', d.data()))
209209
// NOTE: this will only be triggered once and it will be with all the documents
@@ -239,7 +239,7 @@ export function bindCollection(
239239
}
240240
}
241241
}
242-
docChanges.forEach(c => {
242+
docChanges.forEach((c) => {
243243
change[c.type](c)
244244
})
245245

@@ -283,7 +283,7 @@ export function bindDocument(
283283
// bind here the function so it can be resolved anywhere
284284
// this is specially useful for refs
285285
resolve = callOnceWithArg(resolve, () => walkGet(vm, key))
286-
const unbind = document.onSnapshot(snapshot => {
286+
const unbind = document.onSnapshot((snapshot) => {
287287
if (snapshot.exists) {
288288
updateDataFromDocumentSnapshot(options, vm, key, snapshot, subs, ops, 0, resolve)
289289
} else {

packages/@posva/vuefire-core/src/firestore/utils.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export function extractRefs(
2020
oldDoc: firebase.firestore.DocumentData | void,
2121
subs: Record<string, { path: string; data: () => firebase.firestore.DocumentData | null }>
2222
): [firebase.firestore.DocumentData, Record<string, firebase.firestore.DocumentReference>] {
23-
const dataAndRefs: [firebase.firestore.DocumentData, Record<string, firebase.firestore.DocumentReference>] = [
24-
{},
25-
{},
26-
]
23+
const dataAndRefs: [
24+
firebase.firestore.DocumentData,
25+
Record<string, firebase.firestore.DocumentReference>
26+
] = [{}, {}]
2727

2828
const subsByPath = Object.keys(subs).reduce((resultSubs, subKey) => {
2929
const sub = subs[subKey]
@@ -42,7 +42,7 @@ export function extractRefs(
4242
const [data, refs] = result
4343
// Add all properties that are not enumerable (not visible in the for loop)
4444
// getOwnPropertyDescriptors does not exist on IE
45-
Object.getOwnPropertyNames(doc).forEach(propertyName => {
45+
Object.getOwnPropertyNames(doc).forEach((propertyName) => {
4646
const descriptor = Object.getOwnPropertyDescriptor(doc, propertyName)
4747
if (descriptor && !descriptor.enumerable) {
4848
Object.defineProperty(data, propertyName, descriptor)

packages/@posva/vuefire-core/src/rtdb/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function rtdbBindAsObject(
4343
const options = Object.assign({}, DEFAULT_OPTIONS, extraOptions)
4444
const listener = document.on(
4545
'value',
46-
snapshot => {
46+
(snapshot) => {
4747
ops.set(vm, key, options.serialize(snapshot))
4848
},
4949
reject
@@ -88,15 +88,15 @@ export function rtdbBindAsArray(
8888

8989
const childRemoved = collection.on(
9090
'child_removed',
91-
snapshot => {
91+
(snapshot) => {
9292
ops.remove(array, indexForKey(array, snapshot.key))
9393
},
9494
reject
9595
)
9696

9797
const childChanged = collection.on(
9898
'child_changed',
99-
snapshot => {
99+
(snapshot) => {
100100
ops.set(array, indexForKey(array, snapshot.key), options.serialize(snapshot))
101101
},
102102
reject
@@ -113,7 +113,7 @@ export function rtdbBindAsArray(
113113
reject
114114
)
115115

116-
collection.once('value', data => {
116+
collection.once('value', (data) => {
117117
if (options.wait) ops.set(vm, key, array)
118118
resolve(data)
119119
})

0 commit comments

Comments
 (0)