You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.6 KiB

{"ast":null,"code":"export default function debounce(func, duration) {\n var timeout;\n return function () {\n if (!timeout) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n func.apply(this, args);\n timeout = setTimeout(function () {\n timeout = undefined;\n }, duration);\n }\n };\n}","map":{"version":3,"sources":["debounce.tsx"],"names":["debounce","func","duration","timeout","args","apply","setTimeout","undefined"],"mappings":"AAAA,eAAe,SAASA,QAAQ,CAC9BC,IAAO,EACPC,QAAgB,EACb;EACH,IAAIC,OAA4C;EAEhD,OAAO,YAA8B;IACnC,IAAI,CAACA,OAAO,EAAE;MAAA,KAAA,IAAA,IAAA,GAAA,SAAA,CAAA,MAAA,EADeC,IAAI,GAAA,IAAA,KAAA,CAAA,IAAA,CAAA,EAAA,IAAA,GAAA,CAAA,EAAA,IAAA,GAAA,IAAA,EAAA,IAAA,EAAA,EAAA;QAAJA,IAAI,CAAA,IAAA,CAAA,GAAA,SAAA,CAAA,IAAA,CAAA;MAAA;MAG/BH,IAAI,CAACI,KAAK,CAAC,IAAI,EAAED,IAAI,CAAC;MAEtBD,OAAO,GAAGG,UAAU,CAAC,YAAM;QACzBH,OAAO,GAAGI,SAAS;MACrB,CAAC,EAAEL,QAAQ,CAAC;IACd;EACF,CAAC;AACH","sourceRoot":"../../src","sourcesContent":["export default function debounce(func, duration) {\n let timeout;\n return function () {\n if (!timeout) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // eslint-disable-next-line babel/no-invalid-this\n func.apply(this, args);\n timeout = setTimeout(() => {\n timeout = undefined;\n }, duration);\n }\n };\n}\n//# sourceMappingURL=debounce.js.map"]},"metadata":{},"sourceType":"module"}