cdd801c945dfdf9f68cc31a74f0a55ab.json 3.73 KB
{"ast":null,"code":"var __assign = this && this.__assign || function () {\n  __assign = Object.assign || function (t) {\n    for (var s, i = 1, n = arguments.length; i < n; i++) {\n      s = arguments[i];\n\n      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n    }\n\n    return t;\n  };\n\n  return __assign.apply(this, arguments);\n};\n\nexport function create(initialState) {\n  var state = initialState;\n  var listeners = [];\n\n  function setState(partial) {\n    state = __assign(__assign({}, state), partial);\n\n    for (var i = 0; i < listeners.length; i++) {\n      listeners[i]();\n    }\n  }\n\n  function getState() {\n    return state;\n  }\n\n  function subscribe(listener) {\n    listeners.push(listener);\n    return function unsubscribe() {\n      var index = listeners.indexOf(listener);\n      listeners.splice(index, 1);\n    };\n  }\n\n  return {\n    setState: setState,\n    getState: getState,\n    subscribe: subscribe\n  };\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/mini-store/esm/create.js"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","create","initialState","state","listeners","setState","partial","getState","subscribe","listener","push","unsubscribe","index","indexOf","splice"],"mappings":"AAAA,IAAIA,QAAQ,GAAI,QAAQ,KAAKA,QAAd,IAA2B,YAAY;AAClDA,EAAAA,QAAQ,GAAGC,MAAM,CAACC,MAAP,IAAiB,UAASC,CAAT,EAAY;AACpC,SAAK,IAAIC,CAAJ,EAAOC,CAAC,GAAG,CAAX,EAAcC,CAAC,GAAGC,SAAS,CAACC,MAAjC,EAAyCH,CAAC,GAAGC,CAA7C,EAAgDD,CAAC,EAAjD,EAAqD;AACjDD,MAAAA,CAAC,GAAGG,SAAS,CAACF,CAAD,CAAb;;AACA,WAAK,IAAII,CAAT,IAAcL,CAAd,EAAiB,IAAIH,MAAM,CAACS,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCR,CAArC,EAAwCK,CAAxC,CAAJ,EACbN,CAAC,CAACM,CAAD,CAAD,GAAOL,CAAC,CAACK,CAAD,CAAR;AACP;;AACD,WAAON,CAAP;AACH,GAPD;;AAQA,SAAOH,QAAQ,CAACa,KAAT,CAAe,IAAf,EAAqBN,SAArB,CAAP;AACH,CAVD;;AAWA,OAAO,SAASO,MAAT,CAAgBC,YAAhB,EAA8B;AACjC,MAAIC,KAAK,GAAGD,YAAZ;AACA,MAAIE,SAAS,GAAG,EAAhB;;AACA,WAASC,QAAT,CAAkBC,OAAlB,EAA2B;AACvBH,IAAAA,KAAK,GAAGhB,QAAQ,CAACA,QAAQ,CAAC,EAAD,EAAKgB,KAAL,CAAT,EAAsBG,OAAtB,CAAhB;;AACA,SAAK,IAAId,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGY,SAAS,CAACT,MAA9B,EAAsCH,CAAC,EAAvC,EAA2C;AACvCY,MAAAA,SAAS,CAACZ,CAAD,CAAT;AACH;AACJ;;AACD,WAASe,QAAT,GAAoB;AAChB,WAAOJ,KAAP;AACH;;AACD,WAASK,SAAT,CAAmBC,QAAnB,EAA6B;AACzBL,IAAAA,SAAS,CAACM,IAAV,CAAeD,QAAf;AACA,WAAO,SAASE,WAAT,GAAuB;AAC1B,UAAIC,KAAK,GAAGR,SAAS,CAACS,OAAV,CAAkBJ,QAAlB,CAAZ;AACAL,MAAAA,SAAS,CAACU,MAAV,CAAiBF,KAAjB,EAAwB,CAAxB;AACH,KAHD;AAIH;;AACD,SAAO;AACHP,IAAAA,QAAQ,EAAEA,QADP;AAEHE,IAAAA,QAAQ,EAAEA,QAFP;AAGHC,IAAAA,SAAS,EAAEA;AAHR,GAAP;AAKH","sourcesContent":["var __assign = (this && this.__assign) || function () {\n    __assign = Object.assign || function(t) {\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\n            s = arguments[i];\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n                t[p] = s[p];\n        }\n        return t;\n    };\n    return __assign.apply(this, arguments);\n};\nexport function create(initialState) {\n    var state = initialState;\n    var listeners = [];\n    function setState(partial) {\n        state = __assign(__assign({}, state), partial);\n        for (var i = 0; i < listeners.length; i++) {\n            listeners[i]();\n        }\n    }\n    function getState() {\n        return state;\n    }\n    function subscribe(listener) {\n        listeners.push(listener);\n        return function unsubscribe() {\n            var index = listeners.indexOf(listener);\n            listeners.splice(index, 1);\n        };\n    }\n    return {\n        setState: setState,\n        getState: getState,\n        subscribe: subscribe,\n    };\n}\n"]},"metadata":{},"sourceType":"module"}