@live-change/dao-vue3 0.4.0 → 0.4.3
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/RangeBuckets.js +3 -2
- package/lib/live.js +7 -2
- package/package.json +3 -3
package/lib/RangeBuckets.js
CHANGED
|
@@ -47,7 +47,7 @@ class Bucket {
|
|
|
47
47
|
|
|
48
48
|
async load() {
|
|
49
49
|
this.path = this.pathFunction(this.range)
|
|
50
|
-
this.dataPromise = live(this.api(), this.path, fun => onDispose.push(fun))
|
|
50
|
+
this.dataPromise = live(this.api(), this.path, fun => this.onDispose.push(fun))
|
|
51
51
|
this.dataPromise.then(data => {
|
|
52
52
|
this.liveData.value = data
|
|
53
53
|
})
|
|
@@ -134,7 +134,8 @@ class RangeBuckets {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
async wait() {
|
|
137
|
-
//console.log("WAIT FOR BUCKETS", this.buckets.length)
|
|
137
|
+
// console.log("WAIT FOR BUCKETS", this.buckets.length)
|
|
138
|
+
// console.log("BUCKET", this.buckets)
|
|
138
139
|
await Promise.all(this.buckets.map(bucket => bucket.promise)).then(loaded => this)
|
|
139
140
|
}
|
|
140
141
|
|
package/lib/live.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { ref, onUnmounted, getCurrentInstance, unref, reactive } from 'vue'
|
|
1
|
+
import { ref, onUnmounted, getCurrentInstance, unref, reactive, isRef } from 'vue'
|
|
2
2
|
import { collectPointers, ExtendedObservableList } from '@live-change/dao'
|
|
3
|
-
import nodeDebug from
|
|
3
|
+
import nodeDebug from 'debug'
|
|
4
4
|
const debug = nodeDebug('dao-vue3')
|
|
5
5
|
|
|
6
6
|
const liveSymbol = Symbol('live')
|
|
7
7
|
|
|
8
8
|
async function live(api, path, onUnmountedCb) {
|
|
9
|
+
if(isRef(path)) {
|
|
10
|
+
/// TODO: support path as ref/computed
|
|
11
|
+
throw new Error('reactive paths not implemented')
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
if(!onUnmountedCb && typeof window != 'undefined') {
|
|
10
15
|
if(getCurrentInstance()) {
|
|
11
16
|
onUnmountedCb = onUnmounted
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/dao-vue3",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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.4.
|
|
13
|
+
"@live-change/dao": "^0.4.3"
|
|
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": "aeaabe2aa663d30301cae9e80f1f07ee1a4f382c"
|
|
36
36
|
}
|