@live-change/dao-vue3 0.9.17 → 0.9.19

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 +14 -7
  2. package/package.json +3 -3
package/lib/live.js CHANGED
@@ -277,27 +277,34 @@ async function live(api, path, onUnmountedCb) {
277
277
  }
278
278
  }
279
279
  const resultRef = ref()
280
+ let error = null
280
281
  await new Promise((resolve, reject) => {
281
- let error = null
282
- const onError = (msg) => {
283
- console.error("LIVE ERROR", msg, 'WHILE FETCHING', path)
284
- if(error) return
282
+ const onBindError = (msg) => {
283
+ console.error("LIVE BIND ERROR", msg, 'WHILE FETCHING', path)
285
284
  error = msg
286
- reject(error)
285
+ //reject(error)
287
286
  }
288
- const bound = bindResult(path.what, path.more, path.actions, resultRef, 'value', onError)
287
+ const onResolveError = (msg) => {
288
+ console.error("LIVE RESOLVE ERROR", msg, 'WHILE FETCHING', path)
289
+ error = msg
290
+ //reject(error)
291
+ }
292
+ const bound = bindResult(path.what, path.more, path.actions, resultRef, 'value', onBindError)
289
293
  const pathsObserver = (signal, value) => {}
290
294
  preFetchPaths.observe(pathsObserver)
291
295
  onUnmountedCb(() => {
292
296
  preFetchPaths.unobserve(pathsObserver)
293
297
  bound.dispose()
294
298
  })
295
- preFetchPaths.wait().then(resolve).catch(onError)
299
+ preFetchPaths.wait().then((v) => {
300
+ resolve(v)
301
+ }).catch(onResolveError)
296
302
  })
297
303
  while(fetchPromises.length > 0) { // wait for all fetch promises, including ones added by bindResult
298
304
  await fetchPromises.shift()
299
305
  }
300
306
  while(unref(resultRef) === undefined) { // wait for next tick
307
+ if(error) throw new Error(error)
301
308
  await new Promise((resolve) => setTimeout(resolve, 0))
302
309
  }
303
310
  return resultRef
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/dao-vue3",
3
- "version": "0.9.17",
3
+ "version": "0.9.19",
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.9.17"
13
+ "@live-change/dao": "^0.9.19"
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": "b3a9709d000e1a55a5c6e6bf2ad3f0ac5f5956dd"
35
+ "gitHead": "ea1ba1df62d2efac97f43b31aa66b87ec465614a"
36
36
  }