@vueuse/firebase 12.5.0 → 12.6.1
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.cjs +3 -3
- package/index.iife.js +3 -3
- package/index.iife.min.js +1 -1
- package/index.mjs +3 -3
- package/package.json +2 -2
- package/useFirestore.cjs +2 -2
- package/useFirestore.iife.js +2 -2
- package/useFirestore.iife.min.js +1 -1
- package/useFirestore.mjs +2 -2
- package/useRTDB.cjs +1 -1
- package/useRTDB.iife.js +1 -1
- package/useRTDB.iife.min.js +1 -1
- package/useRTDB.mjs +1 -1
package/index.cjs
CHANGED
|
@@ -27,9 +27,9 @@ function getData(docRef) {
|
|
|
27
27
|
}
|
|
28
28
|
function isDocumentReference(docRef) {
|
|
29
29
|
var _a;
|
|
30
|
-
return (((_a = docRef.path) == null ?
|
|
30
|
+
return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
|
|
31
31
|
}
|
|
32
|
-
function useFirestore(maybeDocRef, initialValue =
|
|
32
|
+
function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
|
|
33
33
|
const {
|
|
34
34
|
errorHandler = (err) => console.error(err),
|
|
35
35
|
autoDispose = true
|
|
@@ -71,7 +71,7 @@ function useRTDB(docRef, options = {}) {
|
|
|
71
71
|
errorHandler = (err) => console.error(err),
|
|
72
72
|
autoDispose = true
|
|
73
73
|
} = options;
|
|
74
|
-
const data = vue.ref(
|
|
74
|
+
const data = vue.ref(void 0);
|
|
75
75
|
function update(snapshot) {
|
|
76
76
|
data.value = snapshot.val();
|
|
77
77
|
}
|
package/index.iife.js
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
}
|
|
24
24
|
function isDocumentReference(docRef) {
|
|
25
25
|
var _a;
|
|
26
|
-
return (((_a = docRef.path) == null ?
|
|
26
|
+
return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
|
|
27
27
|
}
|
|
28
|
-
function useFirestore(maybeDocRef, initialValue =
|
|
28
|
+
function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
|
|
29
29
|
const {
|
|
30
30
|
errorHandler = (err) => console.error(err),
|
|
31
31
|
autoDispose = true
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
errorHandler = (err) => console.error(err),
|
|
68
68
|
autoDispose = true
|
|
69
69
|
} = options;
|
|
70
|
-
const data = vue.ref(
|
|
70
|
+
const data = vue.ref(void 0);
|
|
71
71
|
function update(snapshot) {
|
|
72
72
|
data.value = snapshot.val();
|
|
73
73
|
}
|
package/index.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(f,o,i,d,v){"use strict";function h(t){const e=o.ref(t.currentUser),a=o.computed(()=>!!e.value);return t.onIdTokenChanged(s=>e.value=s),{isAuthenticated:a,user:e}}function D(t){const e=t.data();return e&&Object.defineProperty(e,"id",{value:t.id.toString(),writable:!1}),e}function m(t){var e;return(((e=t.path)==null?void 0:e.match(/\//g))||[]).length%2!==0}function S(t,e=void 0,a={}){const{errorHandler:s=l=>console.error(l),autoDispose:u=!0}=a,c=o.isRef(t)?t:o.computed(()=>t);let r=()=>{};const n=o.ref(e);return o.watch(c,l=>{r(),c.value?m(c.value)?r=d.onSnapshot(l,p=>{n.value=D(p)||null},s):r=d.onSnapshot(l,p=>{n.value=p.docs.map(D).filter(i.isDef)},s):n.value=e},{immediate:!0}),u===!0?i.tryOnScopeDispose(()=>{r()}):typeof u=="number"&&i.tryOnScopeDispose(()=>{i.useTimeoutFn(()=>{r()},u)}),n}function g(t,e={}){const{errorHandler:a=n=>console.error(n),autoDispose:s=!0}=e,u=o.ref(void 0);function c(n){u.value=n.val()}const r=v.onValue(t,c,a);return s&&i.tryOnScopeDispose(()=>r()),u}f.useAuth=h,f.useFirestore=S,f.useRTDB=g})(this.VueUse=this.VueUse||{},Vue,VueUse,firebase,firebase);
|
package/index.mjs
CHANGED
|
@@ -25,9 +25,9 @@ function getData(docRef) {
|
|
|
25
25
|
}
|
|
26
26
|
function isDocumentReference(docRef) {
|
|
27
27
|
var _a;
|
|
28
|
-
return (((_a = docRef.path) == null ?
|
|
28
|
+
return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
|
|
29
29
|
}
|
|
30
|
-
function useFirestore(maybeDocRef, initialValue =
|
|
30
|
+
function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
|
|
31
31
|
const {
|
|
32
32
|
errorHandler = (err) => console.error(err),
|
|
33
33
|
autoDispose = true
|
|
@@ -69,7 +69,7 @@ function useRTDB(docRef, options = {}) {
|
|
|
69
69
|
errorHandler = (err) => console.error(err),
|
|
70
70
|
autoDispose = true
|
|
71
71
|
} = options;
|
|
72
|
-
const data = ref(
|
|
72
|
+
const data = ref(void 0);
|
|
73
73
|
function update(snapshot) {
|
|
74
74
|
data.value = snapshot.val();
|
|
75
75
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueuse/firebase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.6.1",
|
|
5
5
|
"description": "Enables realtime bindings for Firebase",
|
|
6
6
|
"author": "Anthony Fu <https://github.com/antfu>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"vue": "^3.5.13",
|
|
63
|
-
"@vueuse/shared": "12.
|
|
63
|
+
"@vueuse/shared": "12.6.1"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild"
|
package/useFirestore.cjs
CHANGED
|
@@ -16,9 +16,9 @@ function getData(docRef) {
|
|
|
16
16
|
}
|
|
17
17
|
function isDocumentReference(docRef) {
|
|
18
18
|
var _a;
|
|
19
|
-
return (((_a = docRef.path) == null ?
|
|
19
|
+
return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
|
|
20
20
|
}
|
|
21
|
-
function useFirestore(maybeDocRef, initialValue =
|
|
21
|
+
function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
|
|
22
22
|
const {
|
|
23
23
|
errorHandler = (err) => console.error(err),
|
|
24
24
|
autoDispose = true
|
package/useFirestore.iife.js
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
function isDocumentReference(docRef) {
|
|
15
15
|
var _a;
|
|
16
|
-
return (((_a = docRef.path) == null ?
|
|
16
|
+
return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
|
|
17
17
|
}
|
|
18
|
-
function useFirestore(maybeDocRef, initialValue =
|
|
18
|
+
function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
|
|
19
19
|
const {
|
|
20
20
|
errorHandler = (err) => console.error(err),
|
|
21
21
|
autoDispose = true
|
package/useFirestore.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,s,
|
|
1
|
+
(function(d,s,c,o){"use strict";function f(t){const e=t.data();return e&&Object.defineProperty(e,"id",{value:t.id.toString(),writable:!1}),e}function m(t){var e;return(((e=t.path)==null?void 0:e.match(/\//g))||[]).length%2!==0}function v(t,e=void 0,h={}){const{errorHandler:p=i=>console.error(i),autoDispose:u=!0}=h,a=o.isRef(t)?t:o.computed(()=>t);let n=()=>{};const r=o.ref(e);return o.watch(a,i=>{n(),a.value?m(a.value)?n=c.onSnapshot(i,l=>{r.value=f(l)||null},p):n=c.onSnapshot(i,l=>{r.value=l.docs.map(f).filter(s.isDef)},p):r.value=e},{immediate:!0}),u===!0?s.tryOnScopeDispose(()=>{n()}):typeof u=="number"&&s.tryOnScopeDispose(()=>{s.useTimeoutFn(()=>{n()},u)}),r}d.useFirestore=v})(this.VueUse=this.VueUse||{},VueUse,firebase,Vue);
|
package/useFirestore.mjs
CHANGED
|
@@ -14,9 +14,9 @@ function getData(docRef) {
|
|
|
14
14
|
}
|
|
15
15
|
function isDocumentReference(docRef) {
|
|
16
16
|
var _a;
|
|
17
|
-
return (((_a = docRef.path) == null ?
|
|
17
|
+
return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
|
|
18
18
|
}
|
|
19
|
-
function useFirestore(maybeDocRef, initialValue =
|
|
19
|
+
function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
|
|
20
20
|
const {
|
|
21
21
|
errorHandler = (err) => console.error(err),
|
|
22
22
|
autoDispose = true
|
package/useRTDB.cjs
CHANGED
package/useRTDB.iife.js
CHANGED
package/useRTDB.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,n
|
|
1
|
+
(function(o,t,u,n){"use strict";function r(i,a={}){const{errorHandler:c=e=>console.error(e),autoDispose:f=!0}=a,s=n.ref(void 0);function l(e){s.value=e.val()}const V=u.onValue(i,l,c);return f&&t.tryOnScopeDispose(()=>V()),s}o.useRTDB=r})(this.VueUse=this.VueUse||{},VueUse,firebase,Vue);
|
package/useRTDB.mjs
CHANGED