@live-change/dao-vue3 0.5.21 → 0.5.22

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.
Files changed (2) hide show
  1. package/lib/live.js +3 -2
  2. package/package.json +3 -3
package/lib/live.js CHANGED
@@ -34,7 +34,7 @@ async function fetch(api, path) {
34
34
  const res = preFetchMap.get(JSON.stringify(what))
35
35
  debug("PREFETCH", what, "RES", res, "MORE", more, "ERR", res?.error)
36
36
  if(res.error) {
37
- throw new Error(res.error + ' when fetching '+JSON.stringify(what) + ' with more=('+JSON.stringify(more)+')')
37
+ throw new Error(JSON.stringify(res.error) + ' when fetching '+JSON.stringify(what) + ' with more=('+JSON.stringify(more)+')')
38
38
  }
39
39
  const data = res.data
40
40
  if(data && more) {
@@ -79,10 +79,11 @@ async function fetch(api, path) {
79
79
  }
80
80
 
81
81
  async function live(api, path, onUnmountedCb) {
82
+ if(path == null) return ref(null)
82
83
  if(isRef(path)) {
83
84
  if(typeof window == 'undefined') {
84
85
  debug("FETCH", path.value)
85
- const data = path.value ? await fetch(api, path.value) : null
86
+ const data = path.value ? await fetch(api, path.value) : ref(null)
86
87
  debug("FETCHED", data)
87
88
  return data
88
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/dao-vue3",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "author": {
5
5
  "email": "m8@em8.pl",
6
6
  "name": "Michał Łaszczewski",
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/live-change/live-change-dao/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@live-change/dao": "^0.5.21"
13
+ "@live-change/dao": "^0.5.22"
14
14
  },
15
15
  "description": "Vue.js integration for live-change dao",
16
16
  "directories": {},
@@ -32,5 +32,5 @@
32
32
  "scripts": {
33
33
  "compileTests": "webpack test/*.js tests-bundle.js"
34
34
  },
35
- "gitHead": "3f0934fef08dabaf243ba16ac561cfe04ef585a3"
35
+ "gitHead": "c44369e98e27df9f5d09142e6c34d02510b018b1"
36
36
  }