2 lines
17 KiB
JavaScript
2 lines
17 KiB
JavaScript
|
/* store.js - Copyright (c) 2010-2017 Marcus Westin */
|
||
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.store=e()}}(function(){var define,module,exports;return function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t,n){"use strict";var r=e("../src/store-engine"),o=e("../storages/all"),i=e("../plugins/all");t.exports=r.createStore(o,i)},{"../plugins/all":2,"../src/store-engine":13,"../storages/all":15}],2:[function(e,t,n){"use strict";t.exports={defaults:e("./defaults"),dump:e("./dump"),events:e("./events"),observe:e("./observe"),expire:e("./expire"),json2:e("./json2"),operations:e("./operations"),update:e("./update"),"v1-backcompat":e("./v1-backcompat")}},{"./defaults":3,"./dump":4,"./events":5,"./expire":6,"./json2":7,"./observe":9,"./operations":10,"./update":11,"./v1-backcompat":12}],3:[function(e,t,n){"use strict";function r(){function e(e,t){n=t}function t(e,t){var r=e();return void 0!==r?r:n[t]}var n={};return{defaults:e,get:t}}t.exports=r},{}],4:[function(e,t,n){"use strict";function r(){function e(e){var t={};return this.each(function(e,n){t[n]=e}),t}return{dump:e}}t.exports=r},{}],5:[function(e,t,n){"use strict";function r(){function e(e,t,n){return c.on(t,u(this,n))}function t(e,t){c.off(t)}function n(e,t,n){c.once(t,u(this,n))}function r(e,t,n){var r=this.get(t);e(),c.fire(t,n,r)}function i(e,t){var n=this.get(t);e(),c.fire(t,void 0,n)}function s(e){var t={};this.each(function(e,n){t[n]=e}),e(),a(t,function(e,t){c.fire(t,void 0,e)})}var c=o();return{watch:e,unwatch:t,once:n,set:r,remove:i,clearAll:s}}function o(){return s(f,{_id:0,_subSignals:{},_subCallbacks:{}})}var i=e("../src/util"),u=i.bind,a=i.each,s=i.create,c=i.slice;t.exports=r;var f={_id:null,_subCallbacks:null,_subSignals:null,on:function(e,t){return this._subCallbacks[e]||(this._subCallbacks[e]={}),this._id+=1,this._subCallbacks[e][this._id]=t,this._subSignals[this._id]=e,this._id},off:function(e){var t=this._subSignals[e];delete this._subCallbacks[t][e],delete this._subSignals[e]},once:function(e,t){var n=this.on(e,u(this,function(){t.apply(this,arguments),this.off(n)}))},fire:function(e){var t=c(arguments,1);a(this._subCallbacks[e],function(e){e.apply(this,t)})}}},{"../src/util":14}],6:[function(e,t,n){"use strict";function r(){function e(e,t,n,i){return this.hasNamespace(o)||r.set(t,i),e()}function t(e,t){if(!this.hasNamespace(o)){var n=r.get(t,Number.MAX_VALUE);n<=(new Date).getTime()&&this.remove(t)}return e()}function n(e,t){return this.hasNamespace(o)||r.remove(t),e()}var r=this.namespace(o);return{set:e,get:t,remove:n}}var o="expire_mixin";t.exports=r},{}],7:[function(e,t,n){"use strict";function r(){return e("./lib/json2"),{}}t.exports=r},{"./lib/json2":8}],8:[function(require,module,exports){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};"object"!==("undefined"==typeof JSON?"undefined":_typeof(JSON))&&(JSON={}),function(){function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,u,a=gap,s=t[e];switch(s&&"object"===("undefined"==typeof s?"undefined":_typeof(s))&&"function"==typeof s.toJSON&&(s=s.toJSON(e)),"function"==typeof rep&&(s=rep.call(t,e,s)
|