@live-change/dao-vue3 0.8.76 → 0.8.77

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 +6 -0
  2. 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.76",
3
+ "version": "0.8.77",
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.76"
13
+ "@live-change/dao": "^0.8.77"
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": "70c9a5ffb257f57b77754027d9c543584ca3423b"
35
+ "gitHead": "9efe599ccee5a7011c934efb91666f0716e9af05"
36
36
  }