@live-change/dao-vue3 0.8.76 → 0.8.78
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 +6 -0
- package/package.json +3 -3
package/lib/live.js
CHANGED
|
@@ -139,6 +139,7 @@ async function live(api, path, onUnmountedCb) {
|
|
|
139
139
|
if(Array.isArray(path)) path = { what: path }
|
|
140
140
|
const paths = [ path ]
|
|
141
141
|
const preFetchPaths = api.observable({ paths })
|
|
142
|
+
const fetchPromises = []
|
|
142
143
|
function bindResult(what, more, actions, object, property, onError) {
|
|
143
144
|
if(!what) throw new Error("what parameter required!")
|
|
144
145
|
const observable = api.observable(what)
|
|
@@ -252,6 +253,7 @@ async function live(api, path, onUnmountedCb) {
|
|
|
252
253
|
extendedObservable.unbindProperty(object, property)
|
|
253
254
|
observable.unobserve(errorObserver)
|
|
254
255
|
}
|
|
256
|
+
fetchPromises.push(extendedObservable.wait())
|
|
255
257
|
} else {
|
|
256
258
|
observable.bindProperty(object, property)
|
|
257
259
|
observable.observe(errorObserver)
|
|
@@ -260,6 +262,7 @@ async function live(api, path, onUnmountedCb) {
|
|
|
260
262
|
observable.unbindProperty(object, property)
|
|
261
263
|
observable.unobserve(errorObserver)
|
|
262
264
|
}
|
|
265
|
+
fetchPromises.push(observable.wait())
|
|
263
266
|
}
|
|
264
267
|
return {
|
|
265
268
|
what, property, dispose
|
|
@@ -283,6 +286,9 @@ async function live(api, path, onUnmountedCb) {
|
|
|
283
286
|
})
|
|
284
287
|
preFetchPaths.wait().then(resolve).catch(onError)
|
|
285
288
|
})
|
|
289
|
+
while(fetchPromises.length > 0) { // wait for all fetch promises, including ones added by bindResult
|
|
290
|
+
await fetchPromises.shift()
|
|
291
|
+
}
|
|
286
292
|
while(unref(resultRef) === undefined) { // wait for next tick
|
|
287
293
|
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
288
294
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/dao-vue3",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.78",
|
|
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-stack/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@live-change/dao": "^0.8.
|
|
13
|
+
"@live-change/dao": "^0.8.78"
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"description": "Vue.js integration for live-change dao",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"compileTests": "webpack test/*.js tests-bundle.js"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "097c9d0026935ae49076b35cffb990ca743d625a"
|
|
36
36
|
}
|