From 87d4bba03e6799c1ef69f66dab4b5d3ba28058bb Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 28 May 2018 12:27:29 +0200 Subject: [PATCH] chore: v3.0.0-beta.15 --- dist/vue-apollo.esm.js | 127 +++++++++++++++++++++++++++++++++++--- dist/vue-apollo.min.js | 2 +- dist/vue-apollo.umd.js | 135 +++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 4 files changed, 244 insertions(+), 22 deletions(-) diff --git a/dist/vue-apollo.esm.js b/dist/vue-apollo.esm.js index 0de4c1e..5eb97c1 100644 --- a/dist/vue-apollo.esm.js +++ b/dist/vue-apollo.esm.js @@ -1,5 +1,116 @@ -import oThrottle from 'throttle-debounce/throttle'; -import oDebounce from 'throttle-debounce/debounce'; +/* eslint-disable no-undefined,no-param-reassign,no-shadow */ + +/** + * Throttle execution of a function. Especially useful for rate limiting + * execution of handlers on events like resize and scroll. + * + * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful. + * @param {Boolean} noTrailing Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the + * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time + * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds, + * the internal counter is reset) + * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is, + * to `callback` when the throttled-function is executed. + * @param {Boolean} debounceMode If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end), + * schedule `callback` to execute after `delay` ms. + * + * @return {Function} A new, throttled, function. + */ +var throttle = function ( delay, noTrailing, callback, debounceMode ) { + + // After wrapper has stopped being called, this timeout ensures that + // `callback` is executed at the proper times in `throttle` and `end` + // debounce modes. + var timeoutID; + + // Keep track of the last time `callback` was executed. + var lastExec = 0; + + // `noTrailing` defaults to falsy. + if ( typeof noTrailing !== 'boolean' ) { + debounceMode = callback; + callback = noTrailing; + noTrailing = undefined; + } + + // The `wrapper` function encapsulates all of the throttling / debouncing + // functionality and when executed will limit the rate at which `callback` + // is executed. + function wrapper () { + + var self = this; + var elapsed = Number(new Date()) - lastExec; + var args = arguments; + + // Execute `callback` and update the `lastExec` timestamp. + function exec () { + lastExec = Number(new Date()); + callback.apply(self, args); + } + + // If `debounceMode` is true (at begin) this is used to clear the flag + // to allow future `callback` executions. + function clear () { + timeoutID = undefined; + } + + if ( debounceMode && !timeoutID ) { + // Since `wrapper` is being called for the first time and + // `debounceMode` is true (at begin), execute `callback`. + exec(); + } + + // Clear any existing timeout. + if ( timeoutID ) { + clearTimeout(timeoutID); + } + + if ( debounceMode === undefined && elapsed > delay ) { + // In throttle mode, if `delay` time has been exceeded, execute + // `callback`. + exec(); + + } else if ( noTrailing !== true ) { + // In trailing throttle mode, since `delay` time has not been + // exceeded, schedule `callback` to execute `delay` ms after most + // recent execution. + // + // If `debounceMode` is true (at begin), schedule `clear` to execute + // after `delay` ms. + // + // If `debounceMode` is false (at end), schedule `callback` to + // execute after `delay` ms. + timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay); + } + + } + + // Return the wrapper function. + return wrapper; + +}; + +/* eslint-disable no-undefined */ + + + +/** + * Debounce execution of a function. Debouncing, unlike throttling, + * guarantees that a function is only executed a single time, either at the + * very beginning of a series of calls, or at the very end. + * + * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful. + * @param {Boolean} atBegin Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds + * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call. + * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset). + * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is, + * to `callback` when the debounced-function is executed. + * + * @return {Function} A new, debounced function. + */ +var debounce = function ( delay, atBegin, callback ) { + return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false); +}; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; @@ -205,9 +316,9 @@ function factory(action) { }; } -var throttle = factory(oThrottle); +var throttle$2 = factory(throttle); -var debounce = factory(oDebounce); +var debounce$1 = factory(debounce); function getMergedDefinition(def) { return Globals.Vue.util.mergeOptions({}, def); @@ -340,8 +451,8 @@ var SmartApollo = function () { // GraphQL Variables if (typeof this.options.variables === 'function') { var _cb = this.executeApollo.bind(this); - _cb = this.options.throttle ? throttle(_cb, this.options.throttle) : _cb; - _cb = this.options.debounce ? debounce(_cb, this.options.debounce) : _cb; + _cb = this.options.throttle ? throttle$2(_cb, this.options.throttle) : _cb; + _cb = this.options.debounce ? debounce$1(_cb, this.options.debounce) : _cb; this._watchers.push(this.vm.$watch(function () { return _this.options.variables.call(_this.vm); }, _cb, { @@ -1709,7 +1820,7 @@ var CApolloMutation = { var keywords = ['$subscribe']; function hasProperty(holder, key) { - return typeof holder !== 'undefined' && holder.hasOwnProperty(key); + return typeof holder !== 'undefined' && Object.prototype.hasOwnProperty.call(holder, key); } function proxyData() { @@ -1896,7 +2007,7 @@ function install(Vue, options) { ApolloProvider.install = install; // eslint-disable-next-line no-undef -ApolloProvider.version = "3.0.0-beta.14"; +ApolloProvider.version = "3.0.0-beta.15"; // Apollo provider var ApolloProvider$1 = ApolloProvider; diff --git a/dist/vue-apollo.min.js b/dist/vue-apollo.min.js index bcd5808..08da217 100644 --- a/dist/vue-apollo.min.js +++ b/dist/vue-apollo.min.js @@ -1 +1 @@ -var VueApollo=function(t,e,i){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,i=i&&i.hasOwnProperty("default")?i.default:i;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=function(){function t(t,e){for(var i=0;i3&&void 0!==arguments[3])||arguments[3];o(this,t),this.type=null,this.vueApolloSpecialKeys=[],this.vm=e,this.key=i,this.initialOptions=r,this.options=Object.assign({},r),this._skip=!1,this._watchers=[],this._destroyed=!1,this.vm.$isServer&&(this.options.fetchPolicy="cache-first"),n&&this.autostart()}return n(t,[{key:"autostart",value:function(){"function"==typeof this.options.skip?this._skipWatcher=this.vm.$watch(this.options.skip.bind(this.vm),this.skipChanged.bind(this),{immediate:!0,deep:this.options.deep}):this.options.skip?this._skip=!0:this.start()}},{key:"skipChanged",value:function(t,e){t!==e&&(this.skip=t)}},{key:"refresh",value:function(){this._skip||(this.stop(),this.start())}},{key:"start",value:function(){var t=this;if(this.starting=!0,"function"==typeof this.initialOptions.query){var e=this.initialOptions.query.bind(this.vm);this.options.query=e(),this._watchers.push(this.vm.$watch(e,function(e){t.options.query=e,t.refresh()},{deep:this.options.deep}))}if("function"==typeof this.initialOptions.document){var i=this.initialOptions.document.bind(this.vm);this.options.document=i(),this._watchers.push(this.vm.$watch(i,function(e){t.options.document=e,t.refresh()},{deep:this.options.deep}))}if("function"==typeof this.initialOptions.context){var r=this.initialOptions.context.bind(this.vm);this.options.context=r(),this._watchers.push(this.vm.$watch(r,function(e){t.options.context=e,t.refresh()},{deep:this.options.deep}))}if("function"==typeof this.options.variables){var o=this.executeApollo.bind(this);o=this.options.throttle?d(o,this.options.throttle):o,o=this.options.debounce?v(o,this.options.debounce):o,this._watchers.push(this.vm.$watch(function(){return t.options.variables.call(t.vm)},o,{immediate:!0,deep:this.options.deep}))}else this.executeApollo(this.options.variables)}},{key:"stop",value:function(){var t=!0,e=!1,i=void 0;try{for(var r,o=this._watchers[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){(0,r.value)()}}catch(t){e=!0,i=t}finally{try{!t&&o.return&&o.return()}finally{if(e)throw i}}this.sub&&(this.sub.unsubscribe(),this.sub=null)}},{key:"generateApolloOptions",value:function(t){var e=b(this.options,this.vueApolloSpecialKeys);return e.variables=t,e}},{key:"executeApollo",value:function(t){this.starting=!1}},{key:"nextResult",value:function(t){var e=t.error;e&&g(e)}},{key:"callHandlers",value:function(t){for(var e=!1,i=arguments.length,r=Array(i>1?i-1:0),o=1;o3&&void 0!==arguments[3])||arguments[3];(o(this,e),r.query)||(r={query:r});t.$data.$apolloData&&!t.$data.$apolloData.queries[i]&&t.$set(t.$data.$apolloData.queries,i,{loading:!1});var s=u(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,r,n));return s.type="query",s.vueApolloSpecialKeys=$,s._loading=!1,r.manual||(s.hasDataField=s.vm.$data.hasOwnProperty(i),s.hasDataField?Object.defineProperty(s.vm.$data.$apolloData.data,i,{get:function(){return s.vm.$data[i]},enumerable:!0,configurable:!0}):Object.defineProperty(s.vm.$data,i,{get:function(){return s.vm.$data.$apolloData.data[i]},enumerable:!0,configurable:!0})),s}return l(e,m),n(e,[{key:"stop",value:function(){a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this),this.observer&&(this.observer.stopPolling(),this.observer=null)}},{key:"executeApollo",value:function(t){if(this.observer?this.observer.setOptions(this.generateApolloOptions(t)):(this.sub&&this.sub.unsubscribe(),this.observer=this.vm.$apollo.watchQuery(this.generateApolloOptions(t))),this.startQuerySubscription(),"no-cache"!==this.options.fetchPolicy){var i=this.maySetLoading();i.loading||this.nextResult(i)}a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"executeApollo",this).call(this,t)}},{key:"startQuerySubscription",value:function(){this.sub&&!this.sub.closed||(this.sub=this.observer.subscribe({next:this.nextResult.bind(this),error:this.catchError.bind(this)}))}},{key:"maySetLoading",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.observer.currentResult();return(t||e.loading)&&(this.loading||this.applyLoadingModifier(1),this.loading=!0),e}},{key:"nextResult",value:function(t){a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"nextResult",this).call(this,t);var i=t.data;t.loading||this.loadingDone();var r="function"==typeof this.options.result;void 0===i||(this.options.manual?r||console.error(this.key+" query must have a 'result' hook in manual mode"):"function"==typeof this.options.update?this.setData(this.options.update.call(this.vm,i)):void 0===i[this.key]&&Object.keys(i).length?console.error("Missing "+this.key+" attribute on result",i):this.setData(i[this.key])),r&&this.options.result.call(this.vm,t)}},{key:"setData",value:function(t){this.vm.$set(this.hasDataField?this.vm.$data:this.vm.$data.$apolloData.data,this.key,t)}},{key:"catchError",value:function(t){a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"catchError",this).call(this,t),this.loadingDone(),this.nextResult(this.observer.currentResult()),this.resubscribeToQuery()}},{key:"resubscribeToQuery",value:function(){var t=this.observer.getLastError(),e=this.observer.getLastResult();this.observer.resetLastResults(),this.startQuerySubscription(),Object.assign(this.observer,{lastError:t,lastResult:e})}},{key:"watchLoading",value:function(){for(var t=arguments.length,e=Array(t),i=0;i0&&void 0!==arguments[0]?arguments[0]:null;if(!t||!t.client){if("object"===r(this.client))return this.client;if(this.client){if(this.provider.clients){var e=this.provider.clients[this.client];if(!e)throw new Error("[vue-apollo] Missing client '"+this.client+"' in 'apolloProvider'");return e}throw new Error("[vue-apollo] Missing 'clients' options in 'apolloProvider'")}return this.provider.defaultClient}var i=this.provider.clients[t.client];if(!i)throw new Error("[vue-apollo] Missing client '"+t.client+"' in 'apolloProvider'");return i}},{key:"watchQuery",value:function(t){var e=this,i=this.getClient(t).watchQuery(t),r=i.subscribe.bind(i);return i.subscribe=function(t){var i=r(t);return e._apolloSubscriptions.push(i),i},i}},{key:"mutate",value:function(t){return this.getClient(t).mutate(t)}},{key:"subscribe",value:function(t){var e=this;if(!this.vm.$isServer){var i=this.getClient(t).subscribe(t),r=i.subscribe.bind(i);return i.subscribe=function(t){var i=r(t);return e._apolloSubscriptions.push(i),i},i}}},{key:"addSmartQuery",value:function(t,e){var i=this,r=y(e,this.vm),o=this.vm.$options.apollo;if(o&&o.$query)for(var n in o.$query)void 0===r[n]&&(r[n]=o.$query[n]);var a=this.queries[t]=new k(this.vm,t,r,!1);if(a.autostart(),!this.vm.$isServer){var l=r.subscribeToMore;l&&(Array.isArray(l)?l.forEach(function(e,r){i.addSmartSubscription(""+t+r,s({},e,{linkedQuery:a}))}):this.addSmartSubscription(t,s({},l,{linkedQuery:a})))}return a}},{key:"addSmartSubscription",value:function(t,e){if(!this.vm.$isServer){e=y(e,this.vm);var i=this.subscriptions[t]=new O(this.vm,t,e,!1);return i.autostart(),i}}},{key:"defineReactiveSetter",value:function(t,e,i){var r=this;this._watchers.push(this.vm.$watch(e,function(e){r[t]=e},{immediate:!0,deep:i}))}},{key:"destroy",value:function(){var t=!0,e=!1,i=void 0;try{for(var r,o=this._watchers[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){(0,r.value)()}}catch(t){e=!0,i=t}finally{try{!t&&o.return&&o.return()}finally{if(e)throw i}}for(var n in this.queries)this.queries[n].destroy();for(var s in this.subscriptions)this.subscriptions[s].destroy();this._apolloSubscriptions.forEach(function(t){t.unsubscribe()}),this._apolloSubscriptions=null,this.vm=null}},{key:"provider",get:function(){return this.vm.$apolloProvider}},{key:"loading",get:function(){return 0!==this.vm.$data.$apolloData.loading}},{key:"data",get:function(){return this.vm.$data.$apolloData.data}},{key:"skipAllQueries",set:function(t){for(var e in this.queries)this.queries[e].skip=t}},{key:"skipAllSubscriptions",set:function(t){for(var e in this.subscriptions)this.subscriptions[e].skip=t}},{key:"skipAll",set:function(t){this.skipAllQueries=t,this.skipAllSubscriptions=t}}]),t}(),_=function(){function t(e){if(o(this,t),!e)throw new Error("Options argument required");this.clients=e.clients||{},this.clients.defaultClient=this.defaultClient=e.defaultClient,this.defaultOptions=e.defaultOptions,this.watchLoading=e.watchLoading,this.errorHandler=e.errorHandler,this.prefetchQueries=[]}return n(t,[{key:"provide",value:function(){return function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$apolloProvider",this)}},{key:"addQueryToPrefetch",value:function(t,e){this.prefetchQueries.push({queryOptions:t,client:e})}},{key:"prefetchComponent",value:function(t,e){var i;i=t;var r=(t=p.Vue.util.mergeOptions({},i)).apollo;if(r){var o=r.$client;for(var n in r){var s=r[n];"$"===n.charAt(0)||s.query&&(void 0!==s.ssr&&!s.ssr||void 0===s.prefetch||!s.prefetch)||this.addQueryToPrefetch(s,s.client||o)}}}},{key:"prefetchComponents",value:function(t){var e=!0,i=!1,r=void 0;try{for(var o,n=t[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value;this.prefetchComponent(s)}}catch(t){i=!0,r=t}finally{try{!e&&n.return&&n.return()}finally{if(i)throw r}}}},{key:"prefetchAll",value:function(t,e,i){var r=this;i||!e||Array.isArray(e)||(i=e,e=void 0);var o=Object.assign({},{includeGlobal:!0},i);return e&&this.prefetchComponents(e),o.includeGlobal&&this.prefetchComponents(S.filter(function(e){e.component;var i=e.contextCallback,r=!0;return"function"==typeof i&&(r=!!i(t)),r}).map(function(t){return t.component}),t),Promise.all(this.prefetchQueries.map(function(e){return r.prefetchQuery(e.queryOptions,t,e.client)}))}},{key:"prefetchQuery",value:function(t,e,i){var o=void 0;if(i){if("string"==typeof i&&!(i=this.clients[i]))throw new Error("[vue-apollo] Missing client '"+i+"' in 'apolloProvider'")}else i=this.defaultClient;if(t.query){var n=t.prefetch,s=void 0===n?"undefined":r(n);if("undefined"!==s){var a=void 0;if(!(a="function"===s?n(e):n))return Promise.resolve();if("boolean"===s){var l=t.variables;o=void 0!==l?"function"==typeof l?l.call(e):l:void 0}else o=a}}else t={query:t};return"function"==typeof t.query&&(t.query=t.query(e)),new Promise(function(e,r){var n=b(t,[].concat(c($),["fetchPolicy"]));n.variables=o,n.fetchPolicy="network-only",i.query(n).then(e,r)})}},{key:"getStates",value:function(t){var e=Object.assign({},{exportNamespace:""},t),i={};for(var r in this.clients){var o=this.clients[r].cache.extract();i[""+e.exportNamespace+r]=o}return i}},{key:"exportStates",value:function(t){var e=Object.assign({},{globalName:"__APOLLO_STATE__",attachTo:"window"},t),i=this.getStates(e);return e.attachTo+"."+e.globalName+" = "+JSON.stringify(i)+";"}}]),t}(),S=[];function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return S.push({component:t,contextCallback:e}),t}"undefined"!=typeof window?window.vueApolloWillPrefetch=A:"undefined"!=typeof global&&(global.vueApolloWillPrefetch=A);var q={name:"ApolloQuery",provide:function(){return{getDollarApollo:this.getDollarApollo,getApolloQuery:this.getApolloQuery}},props:{query:{type:Object,required:!0},variables:{type:Object,default:void 0},fetchPolicy:{type:String,default:void 0},pollInterval:{type:Number,default:void 0},notifyOnNetworkStatusChange:{type:Boolean,default:void 0},context:{type:Object,default:void 0},skip:{type:Boolean,default:!1},clientId:{type:String,default:void 0},deep:{type:Boolean,default:void 0},tag:{type:String,default:"div"}},data:function(){return{result:{data:null,loading:!1,networkStatus:7,error:null,times:0}}},watch:{fetchPolicy:function(t){this.$apollo.queries.query.setOptions({fetchPolicy:t})},pollInterval:function(t){this.$apollo.queries.query.setOptions({pollInterval:t})},notifyOnNetworkStatusChange:function(t){this.$apollo.queries.query.setOptions({notifyOnNetworkStatusChange:t})}},apollo:{$client:function(){return this.clientId},query:function(){return{query:function(){return this.query},variables:function(){return this.variables},fetchPolicy:this.fetchPolicy,pollInterval:this.pollInterval,notifyOnNetworkStatusChange:this.notifyOnNetworkStatusChange,context:function(){return this.context},skip:function(){return this.skip},deep:this.deep,manual:!0,result:function(t){var e=t,i=e.errors,r=e.loading,o=e.networkStatus,n=t.error;t=Object.assign({},t),i&&i.length&&((n=new Error("Apollo errors occured ("+i.length+")")).graphQLErrors=i);var s={};r?Object.assign(s,this.$_previousData,t.data):n?Object.assign(s,this.$apollo.queries.query.observer.getLastResult()||{},t.data):(s=t.data,this.$_previousData=t.data),this.result={data:function(t){return Object.keys(t).length>0}(s)?s:void 0,loading:r,error:n,networkStatus:o,times:++this.$_times},this.$emit("result",this.result)},error:function(t){this.result.loading=!1,this.result.error=t,this.$emit("error",t)}}}},created:function(){this.$_times=0},methods:{getDollarApollo:function(){return this.$apollo},getApolloQuery:function(){return this.$apollo.queries.query}},render:function(t){var e=this.$scopedSlots.default({result:this.result,query:this.$apollo.queries.query,isLoading:this.$apolloData.loading,gqlError:this.result&&this.result.error&&this.result.error.gqlError});return e=Array.isArray(e)?e.concat(this.$slots.default):[e].concat(this.$slots.default),t(this.tag,e)}},P=0,Q={name:"ApolloSubscribeToMore",inject:["getDollarApollo","getApolloQuery"],props:{document:{type:Object,required:!0},variables:{type:Object,default:void 0},updateQuery:{type:Function,default:void 0}},watch:{document:"refresh",variables:"refresh"},created:function(){this.$_key="sub_component_"+P++},mounted:function(){this.refresh()},beforeDestroy:function(){this.destroy()},methods:{destroy:function(){this.$_sub&&this.$_sub.destroy()},refresh:function(){this.destroy(),this.$_sub=this.getDollarApollo().addSmartSubscription(this.$_key,{document:this.document,variables:this.variables,updateQuery:this.updateQuery,linkedQuery:this.getApolloQuery()})}},render:function(t){return null}},j={props:{mutation:{type:Object,required:!0},variables:{type:Object,default:void 0},optimisticResponse:{type:Object,default:void 0},update:{type:Function,default:void 0},refetchQueries:{type:Function,default:void 0},tag:{type:String,default:"div"}},data:function(){return{loading:!1,error:null}},methods:{mutate:function(t){var e=this;this.loading=!0,this.error=null,this.$apollo.mutate(s({mutation:this.mutation,variables:this.variables,optimisticResponse:this.optimisticResponse,update:this.update,refetchQueries:this.refetchQueries},t)).then(function(t){e.$emit("done",t),e.loading=!1}).catch(function(t){g(t),e.error=t,e.$emit("error",t),e.loading=!1})}},render:function(t){var e=this.$scopedSlots.default({mutate:this.mutate,loading:this.loading,error:this.error,gqlError:this.error&&this.error.gqlError});return e=Array.isArray(e)?e.concat(this.$slots.default):[e].concat(this.$slots.default),t(this.tag,e)}},x=["$subscribe"];function D(t,e){return void 0!==t&&t.hasOwnProperty(e)}function L(){var t=this,e=this.$options.apollo;if(e){var i=function(i){"$"!==i.charAt(0)&&(e[i].manual||D(t.$options.props,i)||D(t.$options.computed,i)||D(t.$options.methods,i)||Object.defineProperty(t,i,{get:function(){return t.$data.$apolloData.data[i]},enumerable:!0,configurable:!0}))};for(var r in e)i(r)}}function E(){var t=this,e=this.$apolloProvider;if(!this._apolloLaunched&&e){this._apolloLaunched=!0;var i=this.$options.apollo;if(i){for(var r in i.$init||(i.$init=!0,e.defaultOptions&&(i=this.$options.apollo=Object.assign({},e.defaultOptions,i))),C(this.$apollo,"skipAll",i.$skipAll,i.$deep),C(this.$apollo,"skipAllQueries",i.$skipAllQueries,i.$deep),C(this.$apollo,"skipAllSubscriptions",i.$skipAllSubscriptions,i.$deep),C(this.$apollo,"client",i.$client,i.$deep),C(this.$apollo,"loadingKey",i.$loadingKey,i.$deep),C(this.$apollo,"error",i.$error,i.$deep),C(this.$apollo,"watchLoading",i.$watchLoading,i.$deep),Object.defineProperty(this,"$apolloData",{get:function(){return t.$data.$apolloData},enumerable:!0,configurable:!0}),i)if("$"!==r.charAt(0)){var o=i[r];this.$apollo.addSmartQuery(r,o)}if(i.subscribe&&p.Vue.util.warn("vue-apollo -> `subscribe` option is deprecated. Use the `$subscribe` option instead."),i.$subscribe)for(var n in i.$subscribe)this.$apollo.addSmartSubscription(n,i.$subscribe[n])}}}function C(t,e,i,r){void 0!==i&&("function"==typeof i?t.defineReactiveSetter(e,i,r):t[e]=i)}function M(t,e){if(!M.installed){M.installed=!0,p.Vue=t;var i=t.config.optionMergeStrategies.methods;t.config.optionMergeStrategies.apollo=function(t,e,r){if(!t)return e;if(!e)return t;for(var o=Object.assign({},b(t,x),t.data),n=Object.assign({},b(e,x),e.data),s={},a=0;at?u():!0!==e&&(r=setTimeout(o?function(){r=void 0}:u,void 0===o?t-a:t))}},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var i=0;i3&&void 0!==arguments[3])||arguments[3];o(this,t),this.type=null,this.vueApolloSpecialKeys=[],this.vm=e,this.key=i,this.initialOptions=r,this.options=Object.assign({},r),this._skip=!1,this._watchers=[],this._destroyed=!1,this.vm.$isServer&&(this.options.fetchPolicy="cache-first"),n&&this.autostart()}return r(t,[{key:"autostart",value:function(){"function"==typeof this.options.skip?this._skipWatcher=this.vm.$watch(this.options.skip.bind(this.vm),this.skipChanged.bind(this),{immediate:!0,deep:this.options.deep}):this.options.skip?this._skip=!0:this.start()}},{key:"skipChanged",value:function(t,e){t!==e&&(this.skip=t)}},{key:"refresh",value:function(){this._skip||(this.stop(),this.start())}},{key:"start",value:function(){var t=this;if(this.starting=!0,"function"==typeof this.initialOptions.query){var e=this.initialOptions.query.bind(this.vm);this.options.query=e(),this._watchers.push(this.vm.$watch(e,function(e){t.options.query=e,t.refresh()},{deep:this.options.deep}))}if("function"==typeof this.initialOptions.document){var i=this.initialOptions.document.bind(this.vm);this.options.document=i(),this._watchers.push(this.vm.$watch(i,function(e){t.options.document=e,t.refresh()},{deep:this.options.deep}))}if("function"==typeof this.initialOptions.context){var o=this.initialOptions.context.bind(this.vm);this.options.context=o(),this._watchers.push(this.vm.$watch(o,function(e){t.options.context=e,t.refresh()},{deep:this.options.deep}))}if("function"==typeof this.options.variables){var r=this.executeApollo.bind(this);r=this.options.throttle?f(r,this.options.throttle):r,r=this.options.debounce?d(r,this.options.debounce):r,this._watchers.push(this.vm.$watch(function(){return t.options.variables.call(t.vm)},r,{immediate:!0,deep:this.options.deep}))}else this.executeApollo(this.options.variables)}},{key:"stop",value:function(){var t=!0,e=!1,i=void 0;try{for(var o,r=this._watchers[Symbol.iterator]();!(t=(o=r.next()).done);t=!0){(0,o.value)()}}catch(t){e=!0,i=t}finally{try{!t&&r.return&&r.return()}finally{if(e)throw i}}this.sub&&(this.sub.unsubscribe(),this.sub=null)}},{key:"generateApolloOptions",value:function(t){var e=y(this.options,this.vueApolloSpecialKeys);return e.variables=t,e}},{key:"executeApollo",value:function(t){this.starting=!1}},{key:"nextResult",value:function(t){var e=t.error;e&&b(e)}},{key:"callHandlers",value:function(t){for(var e=!1,i=arguments.length,o=Array(i>1?i-1:0),r=1;r3&&void 0!==arguments[3])||arguments[3];(o(this,e),r.query)||(r={query:r});t.$data.$apolloData&&!t.$data.$apolloData.queries[i]&&t.$set(t.$data.$apolloData.queries,i,{loading:!1});var s=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,r,n));return s.type="query",s.vueApolloSpecialKeys=m,s._loading=!1,r.manual||(s.hasDataField=s.vm.$data.hasOwnProperty(i),s.hasDataField?Object.defineProperty(s.vm.$data.$apolloData.data,i,{get:function(){return s.vm.$data[i]},enumerable:!0,configurable:!0}):Object.defineProperty(s.vm.$data,i,{get:function(){return s.vm.$data.$apolloData.data[i]},enumerable:!0,configurable:!0})),s}return a(e,g),r(e,[{key:"stop",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this),this.observer&&(this.observer.stopPolling(),this.observer=null)}},{key:"executeApollo",value:function(t){if(this.observer?this.observer.setOptions(this.generateApolloOptions(t)):(this.sub&&this.sub.unsubscribe(),this.observer=this.vm.$apollo.watchQuery(this.generateApolloOptions(t))),this.startQuerySubscription(),"no-cache"!==this.options.fetchPolicy){var i=this.maySetLoading();i.loading||this.nextResult(i)}s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"executeApollo",this).call(this,t)}},{key:"startQuerySubscription",value:function(){this.sub&&!this.sub.closed||(this.sub=this.observer.subscribe({next:this.nextResult.bind(this),error:this.catchError.bind(this)}))}},{key:"maySetLoading",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.observer.currentResult();return(t||e.loading)&&(this.loading||this.applyLoadingModifier(1),this.loading=!0),e}},{key:"nextResult",value:function(t){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"nextResult",this).call(this,t);var i=t.data;t.loading||this.loadingDone();var o="function"==typeof this.options.result;void 0===i||(this.options.manual?o||console.error(this.key+" query must have a 'result' hook in manual mode"):"function"==typeof this.options.update?this.setData(this.options.update.call(this.vm,i)):void 0===i[this.key]&&Object.keys(i).length?console.error("Missing "+this.key+" attribute on result",i):this.setData(i[this.key])),o&&this.options.result.call(this.vm,t)}},{key:"setData",value:function(t){this.vm.$set(this.hasDataField?this.vm.$data:this.vm.$data.$apolloData.data,this.key,t)}},{key:"catchError",value:function(t){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"catchError",this).call(this,t),this.loadingDone(),this.nextResult(this.observer.currentResult()),this.resubscribeToQuery()}},{key:"resubscribeToQuery",value:function(){var t=this.observer.getLastError(),e=this.observer.getLastResult();this.observer.resetLastResults(),this.startQuerySubscription(),Object.assign(this.observer,{lastError:t,lastResult:e})}},{key:"watchLoading",value:function(){for(var t=arguments.length,e=Array(t),i=0;i0&&void 0!==arguments[0]?arguments[0]:null;if(!t||!t.client){if("object"===i(this.client))return this.client;if(this.client){if(this.provider.clients){var e=this.provider.clients[this.client];if(!e)throw new Error("[vue-apollo] Missing client '"+this.client+"' in 'apolloProvider'");return e}throw new Error("[vue-apollo] Missing 'clients' options in 'apolloProvider'")}return this.provider.defaultClient}var o=this.provider.clients[t.client];if(!o)throw new Error("[vue-apollo] Missing client '"+t.client+"' in 'apolloProvider'");return o}},{key:"watchQuery",value:function(t){var e=this,i=this.getClient(t).watchQuery(t),o=i.subscribe.bind(i);return i.subscribe=function(t){var i=o(t);return e._apolloSubscriptions.push(i),i},i}},{key:"mutate",value:function(t){return this.getClient(t).mutate(t)}},{key:"subscribe",value:function(t){var e=this;if(!this.vm.$isServer){var i=this.getClient(t).subscribe(t),o=i.subscribe.bind(i);return i.subscribe=function(t){var i=o(t);return e._apolloSubscriptions.push(i),i},i}}},{key:"addSmartQuery",value:function(t,e){var i=this,o=v(e,this.vm),r=this.vm.$options.apollo;if(r&&r.$query)for(var s in r.$query)void 0===o[s]&&(o[s]=r.$query[s]);var a=this.queries[t]=new $(this.vm,t,o,!1);if(a.autostart(),!this.vm.$isServer){var l=o.subscribeToMore;l&&(Array.isArray(l)?l.forEach(function(e,o){i.addSmartSubscription(""+t+o,n({},e,{linkedQuery:a}))}):this.addSmartSubscription(t,n({},l,{linkedQuery:a})))}return a}},{key:"addSmartSubscription",value:function(t,e){if(!this.vm.$isServer){e=v(e,this.vm);var i=this.subscriptions[t]=new k(this.vm,t,e,!1);return i.autostart(),i}}},{key:"defineReactiveSetter",value:function(t,e,i){var o=this;this._watchers.push(this.vm.$watch(e,function(e){o[t]=e},{immediate:!0,deep:i}))}},{key:"destroy",value:function(){var t=!0,e=!1,i=void 0;try{for(var o,r=this._watchers[Symbol.iterator]();!(t=(o=r.next()).done);t=!0){(0,o.value)()}}catch(t){e=!0,i=t}finally{try{!t&&r.return&&r.return()}finally{if(e)throw i}}for(var n in this.queries)this.queries[n].destroy();for(var s in this.subscriptions)this.subscriptions[s].destroy();this._apolloSubscriptions.forEach(function(t){t.unsubscribe()}),this._apolloSubscriptions=null,this.vm=null}},{key:"provider",get:function(){return this.vm.$apolloProvider}},{key:"loading",get:function(){return 0!==this.vm.$data.$apolloData.loading}},{key:"data",get:function(){return this.vm.$data.$apolloData.data}},{key:"skipAllQueries",set:function(t){for(var e in this.queries)this.queries[e].skip=t}},{key:"skipAllSubscriptions",set:function(t){for(var e in this.subscriptions)this.subscriptions[e].skip=t}},{key:"skipAll",set:function(t){this.skipAllQueries=t,this.skipAllSubscriptions=t}}]),t}(),w=function(){function t(e){if(o(this,t),!e)throw new Error("Options argument required");this.clients=e.clients||{},this.clients.defaultClient=this.defaultClient=e.defaultClient,this.defaultOptions=e.defaultOptions,this.watchLoading=e.watchLoading,this.errorHandler=e.errorHandler,this.prefetchQueries=[]}return r(t,[{key:"provide",value:function(){return function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$apolloProvider",this)}},{key:"addQueryToPrefetch",value:function(t,e){this.prefetchQueries.push({queryOptions:t,client:e})}},{key:"prefetchComponent",value:function(t,e){var i;i=t;var o=(t=c.Vue.util.mergeOptions({},i)).apollo;if(o){var r=o.$client;for(var n in o){var s=o[n];"$"===n.charAt(0)||s.query&&(void 0!==s.ssr&&!s.ssr||void 0===s.prefetch||!s.prefetch)||this.addQueryToPrefetch(s,s.client||r)}}}},{key:"prefetchComponents",value:function(t){var e=!0,i=!1,o=void 0;try{for(var r,n=t[Symbol.iterator]();!(e=(r=n.next()).done);e=!0){var s=r.value;this.prefetchComponent(s)}}catch(t){i=!0,o=t}finally{try{!e&&n.return&&n.return()}finally{if(i)throw o}}}},{key:"prefetchAll",value:function(t,e,i){var o=this;i||!e||Array.isArray(e)||(i=e,e=void 0);var r=Object.assign({},{includeGlobal:!0},i);return e&&this.prefetchComponents(e),r.includeGlobal&&this.prefetchComponents(_.filter(function(e){e.component;var i=e.contextCallback,o=!0;return"function"==typeof i&&(o=!!i(t)),o}).map(function(t){return t.component}),t),Promise.all(this.prefetchQueries.map(function(e){return o.prefetchQuery(e.queryOptions,t,e.client)}))}},{key:"prefetchQuery",value:function(t,e,o){var r=void 0;if(o){if("string"==typeof o&&!(o=this.clients[o]))throw new Error("[vue-apollo] Missing client '"+o+"' in 'apolloProvider'")}else o=this.defaultClient;if(t.query){var n=t.prefetch,s=void 0===n?"undefined":i(n);if("undefined"!==s){var a=void 0;if(!(a="function"===s?n(e):n))return Promise.resolve();if("boolean"===s){var l=t.variables;r=void 0!==l?"function"==typeof l?l.call(e):l:void 0}else r=a}}else t={query:t};return"function"==typeof t.query&&(t.query=t.query(e)),new Promise(function(e,i){var n=y(t,[].concat(h(m),["fetchPolicy"]));n.variables=r,n.fetchPolicy="network-only",o.query(n).then(e,i)})}},{key:"getStates",value:function(t){var e=Object.assign({},{exportNamespace:""},t),i={};for(var o in this.clients){var r=this.clients[o].cache.extract();i[""+e.exportNamespace+o]=r}return i}},{key:"exportStates",value:function(t){var e=Object.assign({},{globalName:"__APOLLO_STATE__",attachTo:"window"},t),i=this.getStates(e);return e.attachTo+"."+e.globalName+" = "+JSON.stringify(i)+";"}}]),t}(),_=[];function S(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _.push({component:t,contextCallback:e}),t}"undefined"!=typeof window?window.vueApolloWillPrefetch=S:"undefined"!=typeof global&&(global.vueApolloWillPrefetch=S);var A={name:"ApolloQuery",provide:function(){return{getDollarApollo:this.getDollarApollo,getApolloQuery:this.getApolloQuery}},props:{query:{type:Object,required:!0},variables:{type:Object,default:void 0},fetchPolicy:{type:String,default:void 0},pollInterval:{type:Number,default:void 0},notifyOnNetworkStatusChange:{type:Boolean,default:void 0},context:{type:Object,default:void 0},skip:{type:Boolean,default:!1},clientId:{type:String,default:void 0},deep:{type:Boolean,default:void 0},tag:{type:String,default:"div"}},data:function(){return{result:{data:null,loading:!1,networkStatus:7,error:null,times:0}}},watch:{fetchPolicy:function(t){this.$apollo.queries.query.setOptions({fetchPolicy:t})},pollInterval:function(t){this.$apollo.queries.query.setOptions({pollInterval:t})},notifyOnNetworkStatusChange:function(t){this.$apollo.queries.query.setOptions({notifyOnNetworkStatusChange:t})}},apollo:{$client:function(){return this.clientId},query:function(){return{query:function(){return this.query},variables:function(){return this.variables},fetchPolicy:this.fetchPolicy,pollInterval:this.pollInterval,notifyOnNetworkStatusChange:this.notifyOnNetworkStatusChange,context:function(){return this.context},skip:function(){return this.skip},deep:this.deep,manual:!0,result:function(t){var e=t,i=e.errors,o=e.loading,r=e.networkStatus,n=t.error;t=Object.assign({},t),i&&i.length&&((n=new Error("Apollo errors occured ("+i.length+")")).graphQLErrors=i);var s={};o?Object.assign(s,this.$_previousData,t.data):n?Object.assign(s,this.$apollo.queries.query.observer.getLastResult()||{},t.data):(s=t.data,this.$_previousData=t.data),this.result={data:function(t){return Object.keys(t).length>0}(s)?s:void 0,loading:o,error:n,networkStatus:r,times:++this.$_times},this.$emit("result",this.result)},error:function(t){this.result.loading=!1,this.result.error=t,this.$emit("error",t)}}}},created:function(){this.$_times=0},methods:{getDollarApollo:function(){return this.$apollo},getApolloQuery:function(){return this.$apollo.queries.query}},render:function(t){var e=this.$scopedSlots.default({result:this.result,query:this.$apollo.queries.query,isLoading:this.$apolloData.loading,gqlError:this.result&&this.result.error&&this.result.error.gqlError});return e=Array.isArray(e)?e.concat(this.$slots.default):[e].concat(this.$slots.default),t(this.tag,e)}},q=0,P={name:"ApolloSubscribeToMore",inject:["getDollarApollo","getApolloQuery"],props:{document:{type:Object,required:!0},variables:{type:Object,default:void 0},updateQuery:{type:Function,default:void 0}},watch:{document:"refresh",variables:"refresh"},created:function(){this.$_key="sub_component_"+q++},mounted:function(){this.refresh()},beforeDestroy:function(){this.destroy()},methods:{destroy:function(){this.$_sub&&this.$_sub.destroy()},refresh:function(){this.destroy(),this.$_sub=this.getDollarApollo().addSmartSubscription(this.$_key,{document:this.document,variables:this.variables,updateQuery:this.updateQuery,linkedQuery:this.getApolloQuery()})}},render:function(t){return null}},Q={props:{mutation:{type:Object,required:!0},variables:{type:Object,default:void 0},optimisticResponse:{type:Object,default:void 0},update:{type:Function,default:void 0},refetchQueries:{type:Function,default:void 0},tag:{type:String,default:"div"}},data:function(){return{loading:!1,error:null}},methods:{mutate:function(t){var e=this;this.loading=!0,this.error=null,this.$apollo.mutate(n({mutation:this.mutation,variables:this.variables,optimisticResponse:this.optimisticResponse,update:this.update,refetchQueries:this.refetchQueries},t)).then(function(t){e.$emit("done",t),e.loading=!1}).catch(function(t){b(t),e.error=t,e.$emit("error",t),e.loading=!1})}},render:function(t){var e=this.$scopedSlots.default({mutate:this.mutate,loading:this.loading,error:this.error,gqlError:this.error&&this.error.gqlError});return e=Array.isArray(e)?e.concat(this.$slots.default):[e].concat(this.$slots.default),t(this.tag,e)}},j=["$subscribe"];function D(t,e){return void 0!==t&&Object.prototype.hasOwnProperty.call(t,e)}function x(){var t=this,e=this.$options.apollo;if(e){var i=function(i){"$"!==i.charAt(0)&&(e[i].manual||D(t.$options.props,i)||D(t.$options.computed,i)||D(t.$options.methods,i)||Object.defineProperty(t,i,{get:function(){return t.$data.$apolloData.data[i]},enumerable:!0,configurable:!0}))};for(var o in e)i(o)}}function L(){var t=this,e=this.$apolloProvider;if(!this._apolloLaunched&&e){this._apolloLaunched=!0;var i=this.$options.apollo;if(i){for(var o in i.$init||(i.$init=!0,e.defaultOptions&&(i=this.$options.apollo=Object.assign({},e.defaultOptions,i))),E(this.$apollo,"skipAll",i.$skipAll,i.$deep),E(this.$apollo,"skipAllQueries",i.$skipAllQueries,i.$deep),E(this.$apollo,"skipAllSubscriptions",i.$skipAllSubscriptions,i.$deep),E(this.$apollo,"client",i.$client,i.$deep),E(this.$apollo,"loadingKey",i.$loadingKey,i.$deep),E(this.$apollo,"error",i.$error,i.$deep),E(this.$apollo,"watchLoading",i.$watchLoading,i.$deep),Object.defineProperty(this,"$apolloData",{get:function(){return t.$data.$apolloData},enumerable:!0,configurable:!0}),i)if("$"!==o.charAt(0)){var r=i[o];this.$apollo.addSmartQuery(o,r)}if(i.subscribe&&c.Vue.util.warn("vue-apollo -> `subscribe` option is deprecated. Use the `$subscribe` option instead."),i.$subscribe)for(var n in i.$subscribe)this.$apollo.addSmartSubscription(n,i.$subscribe[n])}}}function E(t,e,i,o){void 0!==i&&("function"==typeof i?t.defineReactiveSetter(e,i,o):t[e]=i)}function C(t,e){if(!C.installed){C.installed=!0,c.Vue=t;var i=t.config.optionMergeStrategies.methods;t.config.optionMergeStrategies.apollo=function(t,e,o){if(!t)return e;if(!e)return t;for(var r=Object.assign({},y(t,j),t.data),n=Object.assign({},y(e,j),e.data),s={},a=0;a delay ) { + // In throttle mode, if `delay` time has been exceeded, execute + // `callback`. + exec(); + + } else if ( noTrailing !== true ) { + // In trailing throttle mode, since `delay` time has not been + // exceeded, schedule `callback` to execute `delay` ms after most + // recent execution. + // + // If `debounceMode` is true (at begin), schedule `clear` to execute + // after `delay` ms. + // + // If `debounceMode` is false (at end), schedule `callback` to + // execute after `delay` ms. + timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay); + } + + } + + // Return the wrapper function. + return wrapper; + +}; + +/* eslint-disable no-undefined */ + + + +/** + * Debounce execution of a function. Debouncing, unlike throttling, + * guarantees that a function is only executed a single time, either at the + * very beginning of a series of calls, or at the very end. + * + * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful. + * @param {Boolean} atBegin Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds + * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call. + * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset). + * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is, + * to `callback` when the debounced-function is executed. + * + * @return {Function} A new, debounced function. + */ +var debounce = function ( delay, atBegin, callback ) { + return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false); +}; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; @@ -211,9 +322,9 @@ function factory(action) { }; } -var throttle = factory(oThrottle); +var throttle$2 = factory(throttle); -var debounce = factory(oDebounce); +var debounce$1 = factory(debounce); function getMergedDefinition(def) { return Globals.Vue.util.mergeOptions({}, def); @@ -346,8 +457,8 @@ var SmartApollo = function () { // GraphQL Variables if (typeof this.options.variables === 'function') { var _cb = this.executeApollo.bind(this); - _cb = this.options.throttle ? throttle(_cb, this.options.throttle) : _cb; - _cb = this.options.debounce ? debounce(_cb, this.options.debounce) : _cb; + _cb = this.options.throttle ? throttle$2(_cb, this.options.throttle) : _cb; + _cb = this.options.debounce ? debounce$1(_cb, this.options.debounce) : _cb; this._watchers.push(this.vm.$watch(function () { return _this.options.variables.call(_this.vm); }, _cb, { @@ -1715,7 +1826,7 @@ var CApolloMutation = { var keywords = ['$subscribe']; function hasProperty(holder, key) { - return typeof holder !== 'undefined' && holder.hasOwnProperty(key); + return typeof holder !== 'undefined' && Object.prototype.hasOwnProperty.call(holder, key); } function proxyData() { @@ -1902,7 +2013,7 @@ function install(Vue, options) { ApolloProvider.install = install; // eslint-disable-next-line no-undef -ApolloProvider.version = "3.0.0-beta.14"; +ApolloProvider.version = "3.0.0-beta.15"; // Apollo provider var ApolloProvider$1 = ApolloProvider; diff --git a/package.json b/package.json index 2b52bb5..2f8fb2d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-apollo", - "version": "3.0.0-beta.14", + "version": "3.0.0-beta.15", "description": "Use Apollo and GraphQL with Vue.js", "main": "dist/vue-apollo.umd.js", "module": "dist/vue-apollo.esm.js",