Fix unnecessary refresh
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vue-apollo",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"description": "Vue apollo integration",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
+3
-4
@@ -12,12 +12,11 @@ class SmartApollo {
|
||||
|
||||
// Query callback
|
||||
if (typeof this.options.query === 'function') {
|
||||
const queryCb = this.options.query
|
||||
this.vm.$watch(queryCb.bind(this.vm), query => {
|
||||
const queryCb = this.options.query.bind(this.vm)
|
||||
this.options.query = queryCb()
|
||||
this.vm.$watch(queryCb, query => {
|
||||
this.options.query = query
|
||||
this.refresh()
|
||||
}, {
|
||||
immediate: true,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user