-
Notifications
You must be signed in to change notification settings - Fork 1
/
minimux.min.js.map
1 lines (1 loc) · 10.3 KB
/
minimux.min.js.map
1
{"version":3,"sources":["minimux.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","_typeof","Symbol","iterator","obj","constructor","reducers","callbacks","middlewares","state","callbackOnion","isArray","Array","register","actions","reducer","console","warn","len","action","push","use","middleware","priority","arguments","undefined","unshift","p","m","coreFunction","newState","type","dispatch","forEach","el","idx","hasOwnProperty","sort","b","reduce","nextLayer","layer","currentAction","listen","callback","unlisten","index","indexOf","splice","getState"],"mappings":"CAAA,QAAUA,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATC,UAAqBA,OAAQ,KAAIF,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGI,EAAE,MAAOA,GAAEJ,GAAE,EAAI,IAAIK,GAAE,GAAIC,OAAM,uBAAuBN,EAAE,IAAK,MAAMK,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEX,EAAEG,IAAIS,WAAYb,GAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGS,QAAkD,IAAI,GAA1CL,GAAkB,kBAATD,UAAqBA,QAAgBH,EAAE,EAAEA,EAAEF,EAAEa,OAAOX,IAAID,EAAED,EAAEE,GAAI,OAAOD,KAAKa,GAAG,SAAST,EAAQU,EAAOJ,GACvd,YAEA,IAAIK,GAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF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!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n/*\n * Minimux v2.0.2\n * Author: Steven Barnett (stevendesu) <[email protected]>\n * License: MIT +no-false-attribs (https://spdx.org/licenses/MITNFA.html)\n *\n * I made this library because I liked the ideology of Redux, but not the\n * implementation. This is my attempt to rebuild Redux with absolute minimal\n * functionality and to allow for absolute minimal bootstrapping in order to\n * write effective code.\n *\n * There are four main API endpoints:\n * - dispatch([actions])\n * This is the only valid way to modify the state\n * - register([actions], reducer)\n * When an action is thrown, apply the reducers\n * - listen(callbacks)\n * Callback will be called with the current state whenever state changes\n * - use(middleware, [priority])\n * Applies middleware to the dispatch function (see documentation)\n */\n\nvar reducers = {};\nvar callbacks = [];\nvar middlewares = [];\n\nvar state = {};\n\n// The \"onion\" describes the layers of middleware that we must parse through\n// in order to execute our action.\nvar callbackOnion = null;\n\n// Faster than Array.isArray:\nvar isArray = function isArray(obj) {\n\treturn obj.constructor === Array;\n};\n\nvar register = function register(actions, reducer) {\n\tif (\"development\" !== \"production\") {\n\t\tif (typeof actions !== \"string\" && ((typeof actions === \"undefined\" ? \"undefined\" : _typeof(actions)) !== \"object\" || !Array.isArray(actions))) {\n\t\t\tthrow \"Invalid type (\" + (typeof actions === \"undefined\" ? \"undefined\" : _typeof(actions)) + \") for argument \\\"actions\\\" passed to listen. Expected string.\";\n\t\t}\n\t\tif (typeof reducer !== \"function\") {\n\t\t\tthrow \"Invalid type (\" + (typeof reducer === \"undefined\" ? \"undefined\" : _typeof(reducer)) + \") for argument \\\"reducer\\\" passed to listen. Expected \" + \"function.\";\n\t\t}\n\t\tif (callbackOnion) {\n\t\t\tconsole.warn(\"You have attempted to add a new reducer after the state was initialized (an action was \" + \"thrown). This is illegal.\");\n\t\t}\n\t}\n\tif (!callbackOnion) {\n\t\tif (!isArray(actions)) {\n\t\t\tactions = [actions];\n\t\t}\n\t\t// For loops are faster than forEach\n\t\tfor (var i = 0, len = actions.length; i < len; i++) {\n\t\t\tvar action = actions[i];\n\t\t\treducers[action] = reducers[action] || [];\n\t\t\treducers[action].push(reducer);\n\t\t}\n\t}\n};\n\nvar use = function use(middleware) {\n\tvar priority = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];\n\n\tif (\"development\" !== \"production\") {\n\t\tif (typeof middleware !== \"function\") {\n\t\t\tthrow \"Invalid type (\" + (typeof middleware === \"undefined\" ? \"undefined\" : _typeof(middleware)) + \") for argument \\\"middleware\\\" passed to listen. Expected \" + \"function.\";\n\t\t}\n\t\tif (typeof priority !== \"number\") {\n\t\t\tthrow \"Invalid type (\" + (typeof priority === \"undefined\" ? \"undefined\" : _typeof(priority)) + \") for argument \\\"priority\\\" passed to listen. Expected \" + \"number.\";\n\t\t}\n\t\tif (callbackOnion) {\n\t\t\tconsole.warn(\"You have attempted to add new middleware after the state was initialized (an action was \" + \"thrown). This is illegal.\");\n\t\t}\n\t}\n\tif (!callbackOnion) {\n\t\tmiddlewares.unshift({ p: priority, m: middleware });\n\t}\n};\n\nvar coreFunction = function coreFunction(action) {\n\tvar newState = state;\n\tif (reducers[action.type]) {\n\t\t// For loops are faster than forEach\n\t\tfor (var i = 0, len = reducers[action.type].length; i < len; i++) {\n\t\t\tnewState = reducers[action.type][i](newState, action);\n\t\t}\n\t}\n\treturn newState;\n};\n\nvar dispatch = function dispatch(actions) {\n\tif (\"development\" !== \"production\") {\n\t\tif ((typeof actions === \"undefined\" ? \"undefined\" : _typeof(actions)) !== \"object\") {\n\t\t\tthrow \"Invalid type (\" + (typeof actions === \"undefined\" ? \"undefined\" : _typeof(actions)) + \") for argument \\\"action\\\" passed to dispatch. Expected \" + \"object or array of objects.\";\n\t\t}\n\t\tif (isArray(actions)) {\n\t\t\tactions.forEach(function (el, idx) {\n\t\t\t\tif ((typeof el === \"undefined\" ? \"undefined\" : _typeof(el)) !== \"object\" || isArray(el)) {\n\t\t\t\t\tthrow \"Invalid type (\" + (typeof el === \"undefined\" ? \"undefined\" : _typeof(el)) + \") for action at index \" + idx + \" passed to dispatch. \" + \"Expected object.\";\n\t\t\t\t}\n\t\t\t\tif (!el.hasOwnProperty(\"type\")) {\n\t\t\t\t\tthrow \"Action at index \" + idx + \" passed to dispatch was missing required property: \\\"type\\\"\";\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (!actions.hasOwnProperty(\"type\")) {\n\t\t\tthrow \"Action passed to dispatch was missing required property: \\\"type\\\"\";\n\t\t}\n\t}\n\tif (!callbackOnion) {\n\t\tmiddlewares.sort(function (a, b) {\n\t\t\treturn a.p - b.p;\n\t\t});\n\t\tcallbackOnion = middlewares.reduce(function (nextLayer, layer) {\n\t\t\treturn function (currentAction) {\n\t\t\t\treturn layer.m(currentAction, nextLayer);\n\t\t\t};\n\t\t}, coreFunction);\n\t}\n\tif (!isArray(actions)) {\n\t\tactions = [actions];\n\t}\n\t// For loops are faster than forEach\n\t// Although length caching only improved performance when there are more than 2-3 elements\n\t// USUALLY dispatch() will be called with 1 action at a time\n\tvar i;\n\tfor (i = 0; i < actions.length; i++) {\n\t\tstate = callbackOnion(actions[i]);\n\t}\n\tfor (i = 0; i < callbacks.length; i++) {\n\t\tcallbacks[i](state);\n\t}\n};\n\nvar listen = function listen(callback) {\n\tif (\"development\" !== \"production\") {\n\t\tif (typeof callback !== \"function\") {\n\t\t\tthrow \"Invalid type (\" + (typeof callback === \"undefined\" ? \"undefined\" : _typeof(callback)) + \") for argument \\\"callback\\\" passed to listen. Expected \" + \"function.\";\n\t\t}\n\t}\n\tcallbacks.push(callback);\n};\n\nvar unlisten = function unlisten(callback) {\n\tvar index = callbacks.indexOf(callback);\n\tif (index !== -1) {\n\t\tcallbacks.splice(index, 1);\n\t}\n};\n\nvar getState = function getState() {\n\treturn state;\n};\n\n// Switching to CommonJS allowed a bit better name mangling for dat mad compression\nmodule.exports = {\n\tgetState: getState,\n\tdispatch: dispatch,\n\tregister: register,\n\tlisten: listen,\n\tunlisten: unlisten,\n\tuse: use\n};\n\n\n},{}]},{},[1]);\n"],"sourceRoot":"/source/"}