73697d063a1da7271736cb8a269aae55.json
5.46 KB
{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport raf from \"rc-util/es/raf\";\nexport function throttleByAnimationFrame(fn) {\n var requestId;\n\n var later = function later(args) {\n return function () {\n requestId = null;\n fn.apply(void 0, _toConsumableArray(args));\n };\n };\n\n var throttled = function throttled() {\n if (requestId == null) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n requestId = raf(later(args));\n }\n };\n\n throttled.cancel = function () {\n return raf.cancel(requestId);\n };\n\n return throttled;\n}\nexport function throttleByAnimationFrameDecorator() {\n return function throttle(target, key, descriptor) {\n var fn = descriptor.value;\n var definingProperty = false;\n return {\n configurable: true,\n get: function get() {\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n // eslint-disable-next-line no-prototype-builtins\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n /* istanbul ignore next */\n return fn;\n }\n\n var boundFn = throttleByAnimationFrame(fn.bind(this));\n definingProperty = true;\n Object.defineProperty(this, key, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n definingProperty = false;\n return boundFn;\n }\n };\n };\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/_util/throttleByAnimationFrame.js"],"names":["_toConsumableArray","raf","throttleByAnimationFrame","fn","requestId","later","args","apply","throttled","_len","arguments","length","Array","_key","cancel","throttleByAnimationFrameDecorator","throttle","target","key","descriptor","value","definingProperty","configurable","get","prototype","hasOwnProperty","boundFn","bind","Object","defineProperty","writable"],"mappings":"AAAA,OAAOA,kBAAP,MAA+B,0CAA/B;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAO,SAASC,wBAAT,CAAkCC,EAAlC,EAAsC;AAC3C,MAAIC,SAAJ;;AAEA,MAAIC,KAAK,GAAG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AACC,EAAE,CAACwB,IAAH,CAAQ,IAAR,CAAD,CAAtC;AACAN,QAAAA,gBAAgB,GAAG,IAAnB;AACAO,QAAAA,MAAM,CAACC,cAAP,CAAsB,IAAtB,EAA4BX,GAA5B,EAAiC;AAC/BE,UAAAA,KAAK,EAAEM,OADwB;AAE/BJ,UAAAA,YAAY,EAAE,IAFiB;AAG/BQ,UAAAA,QAAQ,EAAE;AAHqB,SAAjC;AAKAT,QAAAA,gBAAgB,GAAG,KAAnB;AACA,eAAOK,OAAP;AACD;AArBI,KAAP;AAuBD,GA1BD;AA2BD","sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport raf from \"rc-util/es/raf\";\nexport function throttleByAnimationFrame(fn) {\n var requestId;\n\n var later = function later(args) {\n return function () {\n requestId = null;\n fn.apply(void 0, _toConsumableArray(args));\n };\n };\n\n var throttled = function throttled() {\n if (requestId == null) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n requestId = raf(later(args));\n }\n };\n\n throttled.cancel = function () {\n return raf.cancel(requestId);\n };\n\n return throttled;\n}\nexport function throttleByAnimationFrameDecorator() {\n return function throttle(target, key, descriptor) {\n var fn = descriptor.value;\n var definingProperty = false;\n return {\n configurable: true,\n get: function get() {\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n // eslint-disable-next-line no-prototype-builtins\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n /* istanbul ignore next */\n return fn;\n }\n\n var boundFn = throttleByAnimationFrame(fn.bind(this));\n definingProperty = true;\n Object.defineProperty(this, key, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n definingProperty = false;\n return boundFn;\n }\n };\n };\n}"]},"metadata":{},"sourceType":"module"}