Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
switchMap(user => {
// Define the query
if (user) {
const query = this.ref.where('user', '==', user.uid);
return collectionData(query, 'taskId');
} else {
return [];
}
})
)
(user): ObservableInput => {
if (!user) {
return [];
}
const firestoreReference = firestore
.collection('users')
.doc(user.uid)
.collection('users');
return collectionData(firestoreReference);
}
),
(user): ObservableInput => {
if (!user) {
return [];
}
const firestoreReference = firestore
.collection('users')
.doc(user.uid)
.collection('users');
return collectionData(firestoreReference);
}
),
queries.map(query =>
collectionData(query, idField)
)
(authUser): ObservableInput => {
if (!authUser) {
return empty();
}
const ref = firestore
.collection('users')
.doc(authUser.uid)
.collection('commands');
return collectionData(ref);
}
),
export function useFirestoreCollectionData(
query: firestore.Query,
options?: ReactFireOptions
): T[] {
const queryId = getHashFromFirestoreQuery(query);
return useObservable(
collectionData(query, checkIdField(options)),
queryId,
checkStartWithValue(options)
);
}
(authUser): ObservableInput => {
if (!authUser) {
return empty();
}
const ref = firestore
.collection('configs')
.doc(authUser.uid)
.collection('custom_variables');
return collectionData(ref);
}
),
(authUser): ObservableInput => {
if (!authUser) {
return empty();
}
const ref = firestore
.collection('users')
.doc(authUser.uid)
.collection('timers');
return collectionData(ref);
}
),
(authUser): ObservableInput => {
if (!authUser) {
return empty();
}
const ref = firestore
.collection('users')
.doc(authUser.uid)
.collection('emotes');
return collectionData(ref);
}
),