bugfix: improve reactivity
This commit is contained in:
@ -15,6 +15,9 @@ export const HublReactivity = {
|
||||
this.subscribe();
|
||||
}
|
||||
},
|
||||
refreshData: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
async fetchData(value) {
|
||||
this.resourceId = null;
|
||||
@ -28,9 +31,10 @@ export const HublReactivity = {
|
||||
this.subscribe();
|
||||
},
|
||||
subscribe() {
|
||||
if (this.resourceId && this.targetSrc) {
|
||||
if (this.refreshData === '') { // clears cache and re-fetch data
|
||||
store.subscribeVirtualContainerTo(this.resourceId, this.targetSrc);
|
||||
store.subscribeVirtualContainerTo(this.targetSrc, this.resourceId);
|
||||
} else { // notifies components
|
||||
store.subscribeResourceTo(this.resourceId, this.targetSrc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user