@vueuse/firebase 12.3.0 → 12.4.0

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 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 ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
30
+ return (((_a = docRef.path) == null ? undefined : _a.match(/\//g)) || []).length % 2 !== 0;
31
31
  }
32
- function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
32
+ function useFirestore(maybeDocRef, initialValue = undefined, 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(void 0);
74
+ const data = vue.ref(undefined);
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 ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
26
+ return (((_a = docRef.path) == null ? undefined : _a.match(/\//g)) || []).length % 2 !== 0;
27
27
  }
28
- function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
28
+ function useFirestore(maybeDocRef, initialValue = undefined, 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(void 0);
70
+ const data = vue.ref(undefined);
71
71
  function update(snapshot) {
72
72
  data.value = snapshot.val();
73
73
  }
package/index.iife.min.js CHANGED
@@ -1 +1 @@
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);
1
+ (function(l,u,i,p,h){"use strict";function m(t){const e=u.ref(t.currentUser),a=u.computed(()=>!!e.value);return t.onIdTokenChanged(r=>e.value=r),{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 S(t){var e;return(((e=t.path)==null?void 0:e.match(/\//g))||[]).length%2!==0}function g(t,e=void 0,a={}){const{errorHandler:r=f=>console.error(f),autoDispose:s=!0}=a,c=u.isRef(t)?t:u.computed(()=>t);let o=()=>{};const n=u.ref(e);return u.watch(c,f=>{o(),c.value?S(c.value)?o=p.onSnapshot(f,d=>{n.value=D(d)||null},r):o=p.onSnapshot(f,d=>{n.value=d.docs.map(D).filter(i.isDef)},r):n.value=e},{immediate:!0}),s===!0?i.tryOnScopeDispose(()=>{o()}):typeof s=="number"&&i.tryOnScopeDispose(()=>{i.useTimeoutFn(()=>{o()},s)}),n}function v(t,e={}){const{errorHandler:a=n=>console.error(n),autoDispose:r=!0}=e,s=u.ref(void 0);function c(n){s.value=n.val()}const o=h.onValue(t,c,a);return r&&i.tryOnScopeDispose(()=>o()),s}l.useAuth=m,l.useFirestore=g,l.useRTDB=v})(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 ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
28
+ return (((_a = docRef.path) == null ? undefined : _a.match(/\//g)) || []).length % 2 !== 0;
29
29
  }
30
- function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
30
+ function useFirestore(maybeDocRef, initialValue = undefined, 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(void 0);
72
+ const data = ref(undefined);
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.3.0",
4
+ "version": "12.4.0",
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.3.0"
63
+ "@vueuse/shared": "12.4.0"
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 ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
19
+ return (((_a = docRef.path) == null ? undefined : _a.match(/\//g)) || []).length % 2 !== 0;
20
20
  }
21
- function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
21
+ function useFirestore(maybeDocRef, initialValue = undefined, options = {}) {
22
22
  const {
23
23
  errorHandler = (err) => console.error(err),
24
24
  autoDispose = true
@@ -13,9 +13,9 @@
13
13
  }
14
14
  function isDocumentReference(docRef) {
15
15
  var _a;
16
- return (((_a = docRef.path) == null ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
16
+ return (((_a = docRef.path) == null ? undefined : _a.match(/\//g)) || []).length % 2 !== 0;
17
17
  }
18
- function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
18
+ function useFirestore(maybeDocRef, initialValue = undefined, options = {}) {
19
19
  const {
20
20
  errorHandler = (err) => console.error(err),
21
21
  autoDispose = true
@@ -1 +1 @@
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);
1
+ (function(d,s,f,r){"use strict";function c(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 h(t,e=void 0,D={}){const{errorHandler:p=i=>console.error(i),autoDispose:o=!0}=D,a=r.isRef(t)?t:r.computed(()=>t);let n=()=>{};const u=r.ref(e);return r.watch(a,i=>{n(),a.value?m(a.value)?n=f.onSnapshot(i,l=>{u.value=c(l)||null},p):n=f.onSnapshot(i,l=>{u.value=l.docs.map(c).filter(s.isDef)},p):u.value=e},{immediate:!0}),o===!0?s.tryOnScopeDispose(()=>{n()}):typeof o=="number"&&s.tryOnScopeDispose(()=>{s.useTimeoutFn(()=>{n()},o)}),u}d.useFirestore=h})(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 ? void 0 : _a.match(/\//g)) || []).length % 2 !== 0;
17
+ return (((_a = docRef.path) == null ? undefined : _a.match(/\//g)) || []).length % 2 !== 0;
18
18
  }
19
- function useFirestore(maybeDocRef, initialValue = void 0, options = {}) {
19
+ function useFirestore(maybeDocRef, initialValue = undefined, options = {}) {
20
20
  const {
21
21
  errorHandler = (err) => console.error(err),
22
22
  autoDispose = true
package/useRTDB.cjs CHANGED
@@ -9,7 +9,7 @@ function useRTDB(docRef, options = {}) {
9
9
  errorHandler = (err) => console.error(err),
10
10
  autoDispose = true
11
11
  } = options;
12
- const data = vue.ref(void 0);
12
+ const data = vue.ref(undefined);
13
13
  function update(snapshot) {
14
14
  data.value = snapshot.val();
15
15
  }
package/useRTDB.iife.js CHANGED
@@ -6,7 +6,7 @@
6
6
  errorHandler = (err) => console.error(err),
7
7
  autoDispose = true
8
8
  } = options;
9
- const data = vue.ref(void 0);
9
+ const data = vue.ref(undefined);
10
10
  function update(snapshot) {
11
11
  data.value = snapshot.val();
12
12
  }
@@ -1 +1 @@
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);
1
+ (function(u,n,o,t){"use strict";function r(i,a={}){const{errorHandler:c=e=>console.error(e),autoDispose:f=!0}=a,s=t.ref(void 0);function d(e){s.value=e.val()}const l=o.onValue(i,d,c);return f&&n.tryOnScopeDispose(()=>l()),s}u.useRTDB=r})(this.VueUse=this.VueUse||{},VueUse,firebase,Vue);
package/useRTDB.mjs CHANGED
@@ -7,7 +7,7 @@ function useRTDB(docRef, options = {}) {
7
7
  errorHandler = (err) => console.error(err),
8
8
  autoDispose = true
9
9
  } = options;
10
- const data = ref(void 0);
10
+ const data = ref(undefined);
11
11
  function update(snapshot) {
12
12
  data.value = snapshot.val();
13
13
  }