UNPKG

2.38 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Revue=e():t.Revue=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){"use strict";function n(t){var e=t,r=t;if(s.test(t)){var n=t.match(s),o=i.slicedToArray(n,3);r=o[1],e=o[2]}return{storeProp:r,realProp:e}}function o(t,e){t.mixin({created:function(){var t=this;if(this._bindProps){var r=function(){t._bindProps.forEach(function(r){var n=r.storeProp,o=r.realProp;if(o&&n){var i=e.getState()[n];t.$set(o,i)}})};this._unsubscribe=e.subscribe(r)}},beforeDestroy:function(){this._unsubscribe&&this._unsubscribe()}}),t.prototype.$select=function(t){return this._bindProps=this._bindProps||[],t=n(t),this._bindProps.push(t),e.getState()[t.storeProp]}}var i={};i.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i.createClass=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i.slicedToArray=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(u){o=!0,i=u}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var s=/^([a-zA-Z0-9_-]+)\s{1,2}as\s{1,2}([a-zA-Z0-9\._-]+)$/i,a=!1,u=function(){function t(e,r,n){i.classCallCheck(this,t),this.store=r,o(e,this.store),n&&(this.reduxActions=n)}return i.createClass(t,[{key:"dispatch",value:function(){var t;return(t=this.store).dispatch.apply(t,arguments)}},{key:"state",get:function(){return this.store.getState()}},{key:"actions",get:function(){if(a&&!this.reduxActions)throw new Error("[Revue] Binding actions to Revue before calling them!");return this.reduxActions}}]),t}();t.exports=u}])});
\No newline at end of file