@edgedev/firebase 1.0.12 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +4 -5
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -26,9 +26,9 @@ const app = initializeApp(firebaseConfig);
|
|
|
26
26
|
const db = getFirestore(app);
|
|
27
27
|
|
|
28
28
|
// Simple Store Items (add matching key per firebase collection)
|
|
29
|
-
export const data = reactive({});
|
|
30
|
-
export const unsubscibe = reactive({});
|
|
31
|
-
export const user = ref({});
|
|
29
|
+
export const data: object = reactive({});
|
|
30
|
+
export const unsubscibe: object = reactive({});
|
|
31
|
+
export const user: object = ref({});
|
|
32
32
|
|
|
33
33
|
// Composable to start snapshot listener and set unsubscribe function
|
|
34
34
|
export const startSnapshot = (collectionPath: string): void => {
|
|
@@ -52,11 +52,10 @@ export const storeDoc = (collectionPath: string, item: object): void => {
|
|
|
52
52
|
const cloneItem = JSON.parse(JSON.stringify(item));
|
|
53
53
|
const current_time = new Date().getTime();
|
|
54
54
|
cloneItem.last_updated = current_time;
|
|
55
|
+
cloneItem.uid = null;
|
|
55
56
|
if (Object.prototype.hasOwnProperty.call(user, "uid")) {
|
|
56
|
-
console.log(user);
|
|
57
57
|
cloneItem.uid = user["uid"];
|
|
58
58
|
}
|
|
59
|
-
console.log(cloneItem);
|
|
60
59
|
if (!Object.prototype.hasOwnProperty.call(cloneItem, "doc_created_at")) {
|
|
61
60
|
cloneItem.doc_created_at = current_time;
|
|
62
61
|
}
|