@live-change/dao-vue3 0.5.17 → 0.5.18
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/lib/live.js +5 -3
- package/package.json +3 -3
package/lib/live.js
CHANGED
|
@@ -33,7 +33,9 @@ async function fetch(api, path) {
|
|
|
33
33
|
function createObject(what, more) {
|
|
34
34
|
const res = preFetchMap.get(JSON.stringify(what))
|
|
35
35
|
debug("PREFETCH", what, "RES", res, "MORE", more, "ERR", res?.error)
|
|
36
|
-
if(res.error)
|
|
36
|
+
if(res.error) {
|
|
37
|
+
throw new Error(res.error)
|
|
38
|
+
}
|
|
37
39
|
const data = res.data
|
|
38
40
|
if(data && more) {
|
|
39
41
|
if(Array.isArray(data)) {
|
|
@@ -80,7 +82,7 @@ async function live(api, path, onUnmountedCb) {
|
|
|
80
82
|
if(isRef(path)) {
|
|
81
83
|
if(typeof window == 'undefined') {
|
|
82
84
|
debug("FETCH", path.value)
|
|
83
|
-
const data = await fetch(api, path.value)
|
|
85
|
+
const data = path.value ? await fetch(api, path.value) : null
|
|
84
86
|
debug("FETCHED", data)
|
|
85
87
|
return data
|
|
86
88
|
}
|
|
@@ -107,7 +109,7 @@ async function live(api, path, onUnmountedCb) {
|
|
|
107
109
|
}
|
|
108
110
|
await update()
|
|
109
111
|
watch(() => path.value, () => update())
|
|
110
|
-
const result = computed(() => liveRef.value?.value)
|
|
112
|
+
const result = computed(() => liveRef.value === null ? null : liveRef.value?.value)
|
|
111
113
|
return result
|
|
112
114
|
}
|
|
113
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/dao-vue3",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.18",
|
|
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.
|
|
13
|
+
"@live-change/dao": "^0.5.18"
|
|
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": "
|
|
35
|
+
"gitHead": "4520565fccea311fd162a62f809d36aafab320e0"
|
|
36
36
|
}
|