@primayer/activity-firestore
v1.0.11
Published
Firebase Firestore for activity logging
Downloads
3
Readme
Activity Firestore
usage
import the firestore
import { ActivityFirestore } from "@primayer/activity-firestore";
init
ActivityFirestore.init(config);
add document
ActivityFirestore.add(id, { });
get documents
ActivityFirestore.getCollection(id, (docs) => {
docs.forEach(doc => {
});
});
get in datetime range
ActivityFirestore.getInRange(id, start, end, (docs) => {
docs.forEach(doc => {
});
});
watch for doc added
ActivityFirestore.watchCollection(id, (doc) => {
});
clear watch
ActivityFirestore.clearListeners();
ActivityFirestore.clearListener(index);
access the product/type enums for Activities
import { Products, Types } from "@primayer/activity-firestore";