From 540d9dc93b6fd862ca4ff0344ef9a6c739d5f282 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Wed, 21 Sep 2016 10:55:50 +0200 Subject: [PATCH] Moved initial queries to created hook --- lib/vue-plugin.js | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vue-plugin.js b/lib/vue-plugin.js index 8f78962..c930c90 100644 --- a/lib/vue-plugin.js +++ b/lib/vue-plugin.js @@ -162,7 +162,9 @@ function prepare() { this._apolloSubscriptions = []; this.$apollo = new DollarApollo(this); +} +function launch() { let apollo = this.$options.apollo; if (apollo) { @@ -194,6 +196,8 @@ module.exports = { // Vue 2.x beforeCreate: prepare, + created: launch, + destroyed: function() { this._apolloSubscriptions.forEach((sub) => { sub.unsubscribe(); diff --git a/package.json b/package.json index c3cc322..74702e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-apollo", - "version": "1.0.0-beta7-1", + "version": "1.0.0-beta7-2", "description": "Vue apollo integration", "main": "index.js", "scripts": {