@live-change/dao 0.9.111 → 0.9.113
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/DaoPrerenderCache.js +3 -3
- package/package.json +2 -2
package/lib/DaoPrerenderCache.js
CHANGED
|
@@ -44,7 +44,7 @@ class DaoPrerenderCache {
|
|
|
44
44
|
}
|
|
45
45
|
if(this.mode === 'save') {
|
|
46
46
|
observable = new ObservableValue()
|
|
47
|
-
this.get(what).then(value => {
|
|
47
|
+
Promise.resolve(this.get(what)).then(value => {
|
|
48
48
|
if(value && typeof value === 'object') value[sourceSymbol] = what
|
|
49
49
|
observable.set(value)
|
|
50
50
|
}).catch(error => observable.error(error))
|
|
@@ -92,7 +92,7 @@ class DaoPrerenderCache {
|
|
|
92
92
|
|
|
93
93
|
if(this.mode === 'save') {
|
|
94
94
|
if(!promise) throw new Error("GET NOT FOUND: "+what)
|
|
95
|
-
promise.then(result => {
|
|
95
|
+
Promise.resolve(promise).then(result => {
|
|
96
96
|
let observable = this.observables.get(cacheKey)
|
|
97
97
|
if(observable) {
|
|
98
98
|
if(typeof observable == 'function') {
|
|
@@ -122,7 +122,7 @@ class DaoPrerenderCache {
|
|
|
122
122
|
})
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
return promise.then(data => {
|
|
125
|
+
return Promise.resolve(promise).then(data => {
|
|
126
126
|
if(data && typeof data === 'object') data[sourceSymbol] = what
|
|
127
127
|
return data
|
|
128
128
|
})
|
package/package.json
CHANGED