🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

rc-hooks

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-hooks - npm Package Compare versions

Comparing version
3.3.0
to
3.3.1
+1
-1
dist/rcHooks.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).rcHooks={},t.React)}(this,function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function i(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(u,c)}a((r=r.apply(t,e||[])).next())})}function u(t,e){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var a=void 0,s="undefined",l=Object.prototype,f=l.toString,h=l.hasOwnProperty,p="[object ",d=p+"String]",v=p+"Symbol]",y=p+"Window]";function g(t){return null!==t&&"object"==typeof t}function m(t){return f.call(t)}var b=/^0b[01]+$/i,w=/^0o[0-7]+$/i,k=/^[-+]0x[0-9a-f]+$/i;function T(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||m(t)===v}(t))return NaN;if(function(t){return"function"==typeof t||g(t)}(t)&&(t=Number(t)),"string"!=typeof t)return 0===t?t:+t;t=t.trim();var e=b.test(t);return e||w.test(t)?parseInt(t.slice(2),e?2:8):k.test(t)?NaN:+t}function _(t){return Array.isArray(t)}function S(t,e,n){return void 0===n&&(n=!1),t===e?!n||(0!==t||1/t==1/e):t!=t&&e!=e}var E=typeof window!==s&&g(window)&&typeof document!==s&&g(document)&&window.document===document;m(function(){return arguments}());function O(t){return t===a}function C(t,e,n,r){if(void 0===r&&(r=!1),"function"!=typeof t)throw new TypeError("Expected a function");var o,i,u,c,s,l,f,h;function p(e){return u=e,l=t.apply(s,c),s=c=a,l}function d(){for(var t=[],f=0;f<arguments.length;f++)t[f]=arguments[f];s=this,c=t;var h=Date.now(),d=function(t){if(i===a)return!0;var n=t-i;return n>=e||n<0||r&&t-u>=e}(h),v=r?d||i===a||o!==a?e:e-(h-i):e;return i=h,d&&n&&o===a?p(h):(o===a||r||(clearTimeout(o),o=a),o===a&&(o=setTimeout(function(){o=a,p(Date.now())},v)),l)}return f=T(e),h=0,e=null==f||f!=f?h:f,d.cancel=function(){o!==a&&(clearTimeout(o),o=a),i=o=c=s=a},d.flush=function(){return o!==a?(clearTimeout(o),o=a,p(Date.now())):l},d.pending=function(){return o!==a},d}function L(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=!1),C(t,e,n)}function I(t,e){var n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=!0,t.apply(void 0,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],c(r),!1)),setTimeout(function(){n=!1},e))}}function R(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=!0),C(t,e,n,!0)}function P(t){return g(t)&&m(t)===y}function j(t){return arguments.length?_(t)?t:[t]:[]}function x(){}function V(t){var n=e.useRef(t);return n.current=t,n}function N(t){var n=V(t),r=e.useCallback(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=n.current;return null==r?void 0:r.apply(void 0,t)},[]);return r}var F=function(t,n){var r=e.useRef(!1);e.useEffect(function(){if(r.current)return t();r.current=!0},n)},D=function(){var t=e.useRef(!1);return e.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]),t},A=function(){function t(){this.handlers={}}return t.prototype.eventNames=function(){var t,e=(null===(t=Object.getOwnPropertySymbols)||void 0===t?void 0:t.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(e)},t.prototype.rawListeners=function(t){var e=this.handlers[t];return e?e.map(function(t){return t.raw}):[]},t.prototype.listeners=function(t){var e=this.handlers[t];return e?e.map(function(t){return t.wrap}):[]},t.prototype.hasListener=function(t,e){return this.rawListeners(t).some(function(t){return t===e})},t.prototype._on=function(t,e,n,r,o){void 0===r&&(r=null),void 0===o&&(o=1);var i={raw:e,wrap:n,context:r};if(this.handlers[t]){var u=1===o?"push":"unshift";this.handlers[t][u](i)}else this.handlers[t]=[i];return this},t.prototype.prependListener=function(t,e,n){return this._on(t,e,e,n,0)},t.prototype.on=function(t,e,n){return this._on(t,e,e,n)},t.prototype._wrapOnce=function(t,e,n){var r=this;void 0===n&&(n=null);var o=function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];e.apply(n,i),r.off(t,o)};return o},t.prototype.once=function(t,e,n){var r=this._wrapOnce(t,e,n);return this._on(t,e,r,n)},t.prototype.prependOnceListener=function(t,e,n){var r=this._wrapOnce(t,e,n);return this._on(t,e,r,n,0)},t.prototype.off=function(t,e){var n=this.handlers[t];if(n)if(e){var r=n.findIndex(function(t){return t.wrap===e||t.raw===e});-1!==r&&n.splice(r,1)}else delete this.handlers[t];return this},t.prototype.offAll=function(){return this.handlers={},this},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=this.handlers[t];return!!(r&&r.length>0)&&(r.forEach(function(t){t.wrap.apply(t.context,e)}),!0)},t}(),M={},W=function(){function t(t){void 0===t&&(t="default"),this.scope=t,M[this.scope]||(M[this.scope]={}),this.data=M[this.scope]}return t.prototype.getItem=function(t){return t in this.data?this.data[t]:null},t.prototype.setItem=function(t,e){this.data[t]=e},t.prototype.removeItem=function(t){delete this.data[t]},t.prototype.clear=function(){M[this.scope]={},this.data=M[this.scope]},t}();function z(t){try{var e="object"==typeof t&&null!==t&&!!t.setItem&&!!t.getItem&&!!t.removeItem;if(e){var n=Math.random().toString(16).substring(2,8)+(new Date).getTime();if(t.setItem(n,"1"),"1"!==t.getItem(n))return!1;t.removeItem(n)}return e}catch(e){return console.error("[cache2] ".concat(t," is not supported. The default memory cache will be used.")),!1}}var K=function(){function t(t,e){void 0===e&&(e={});var n=!!t&&z(t);this.options=r({needParsed:n,prefix:""},e),this.storage=n?t:new W(this.options.memoryScope)}return t.prototype.getKey=function(t){return this.options.prefix+t},t.prototype.get=function(t){var e=this.storage.getItem(this.getKey(t));return this.options.needParsed?function(t,e){try{return JSON.parse(t,e)}catch(e){return t}}(e,this.options.reviver):e},t.prototype.set=function(t,e){this.storage.setItem(this.getKey(t),this.options.needParsed?function(t,e){return JSON.stringify(t,e)}(e,this.options.replacer):e)},t.prototype.del=function(t){this.storage.removeItem(this.getKey(t))},t.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},t}(),H="default",U=function(t){function e(e,n){var o,i=t.call(this)||this,u=H;return"string"==typeof e?u=e||H:"object"==typeof e&&(o=e),o||"object"!=typeof n||(o=n),i.options=r({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},o),i.storage=new K(i.options.storage,r({memoryScope:u},i.options)),i.cacheKey=u,i.startCheckperiod(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._check=function(t,e){var n=!0;return 0!==e.t&&e.t<Date.now()&&(n=!1,this.del(t),this.emit("expired",t,e.v)),n},e.prototype._wrap=function(t,e){var n=Date.now(),r="number"==typeof e?e:this.options.stdTTL;return{v:t,t:r>0?n+r:0,n:n}},e.prototype._isLimited=function(t){return this.options.max>-1&&t>=this.options.max},e.prototype._getReplaceKey=function(t,e){var n=t[0];return t.forEach(function(t){(e[t].t<e[n].t||e[t].t===e[n].t&&e[t].n<e[n].n)&&(n=t)}),n},Object.defineProperty(e.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),e.prototype.setCacheValues=function(t){this.storage.set(this.cacheKey,t)},e.prototype.get=function(t){var e=this.cacheValues[t];if(e&&this._check(t,e))return e.v},e.prototype.mget=function(t){var e=this,n={};if(!Array.isArray(t))return n;var r=this.cacheValues;return t.forEach(function(t){var o=r[t];o&&e._check(t,o)&&(n[t]=o.v)}),n},e.prototype.getAll=function(){var t=Object.keys(this.cacheValues);return this.mget(t)},e.prototype.set=function(t,e,n){if(0===this.options.max)return!1;var r=this.cacheValues,o=Object.keys(r);if(!r[t]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var u=this._getReplaceKey(i,r);this.del(u)}}return r[t]=this._wrap(e,n),this.setCacheValues(r),this.emit("set",t,r[t].v),!0},e.prototype.mset=function(t){var e=this,n=!0;return t.forEach(function(t){var r=e.set(t.key,t.value,t.ttl);n&&!r&&(n=!1)}),n},e.prototype.del=function(t){var e=this,n=this.cacheValues,r=0;return(Array.isArray(t)?t:[t]).forEach(function(t){if(n[t]){r++;var o=n[t];delete n[t],e.emit("del",t,o.v)}}),r>0&&this.setCacheValues(n),r},e.prototype.clear=function(){this.storage.del(this.cacheKey)},e.prototype.keys=function(){var t=this,e=this.cacheValues;return Object.keys(e).filter(function(n){return t._check(n,e[n])})},e.prototype.has=function(t){var e=this.cacheValues[t];return!(!e||!this._check(t,e))},e.prototype.take=function(t){var e,n=this.cacheValues[t];return n&&this._check(t,n)&&(e=n.v,this.del(t)),e},e.prototype.ttl=function(t,e){var n=this.cacheValues,r=n[t];return!(!r||!this._check(t,r))&&(n[t]=this._wrap(r.v,e),!0)},e.prototype.getTtl=function(t){var e=this.cacheValues,n=e[t];if(n&&this._check(t,n))return e[t].t},e.prototype.getLastModified=function(t){var e=this.cacheValues,n=e[t];if(n&&this._check(t,n))return e[t].n},e.prototype.startCheckperiod=function(){var t=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout(function(){t.startCheckperiod()},this.options.checkperiod))},e.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},e}(A),B=function(){function t(t,e){void 0===e&&(e="uh_async_memo"),this.promiseCache={},this.cache=new U(e,t)}return t.prototype.run=function(t,e,n){var o,i=this;if(!e||"string"!=typeof(o=e)&&m(o)!==d)return t();var u=r({persisted:!0},n);if(u.persisted){var c=this.cache.get(e);if(c)return Promise.resolve(c)}return this.promiseCache[e]||(this.promiseCache[e]=t().then(function(t){return delete i.promiseCache[e],i.cache.set(e,t,u.ttl),t}).catch(function(t){return delete i.promiseCache[e],Promise.reject(t)})),this.promiseCache[e]},t}();function $(){return"undefined"==typeof document||void 0===document.visibilityState||"hidden"!==document.visibilityState}var J=[];var q=!1;if("undefined"!=typeof window&&window.addEventListener&&!q){window.addEventListener("visibilitychange",function(){if($())for(var t=0;t<J.length;t++){(0,J[t])()}},!1),q=!0}var G=[];var Y=!1;if("undefined"!=typeof window&&window.addEventListener&&!Y){var Q=function(){if($()&&("undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine))for(var t=0;t<G.length;t++){(0,G[t])()}};window.addEventListener("visibilitychange",Q,!1),window.addEventListener("focus",Q,!1),Y=!0}var X="rc-hooks",Z=new B({prefix:X,stdTTL:3e5});function tt(t){return Z.cache.get(t)}var et=function(){function t(t,e){this.params=[],this.pollingWhenVisibleFlag=!1,this.pollingTimer=null,this.counter=1,this.destroyed=!1,this.async=t,this.options=r({cacheTime:3e5,persisted:!1,pollingWhenHidden:!0,refreshOnWindowFocus:!1,focusTimespan:5e3},e),this.unsubscribes=[],this.init()}return t.prototype.init=function(){var t,e=this.options,n=e.pollingInterval,r=e.refreshOnWindowFocus,o=e.focusTimespan;if(this.updateDebounce(),n&&this.unsubscribes.push((t=this.rePolling.bind(this),J.push(t),function(){var e=J.indexOf(t);J.splice(e,1)})),r){var i=I(this.refresh.bind(this),o);this.unsubscribes.push(function(t){return G.push(t),function(){var e=G.indexOf(t);G.splice(e,1)}}(i))}},t.prototype.updateDebounce=function(){var t=this.options,e=t.debounceInterval,n=t.throttleInterval;this.debounce="number"==typeof e&&e>0?L(this._wraprun,e):void 0,this.throttle="number"==typeof n&&n>0?R(this._wraprun,n):void 0},t.prototype.rePolling=function(){this.pollingWhenVisibleFlag&&(this.pollingWhenVisibleFlag=!1,this.refresh())},t.prototype.afterUpdateOptions=function(t,e){void 0===e&&(e={}),("debounceInterval"in e&&e.debounceInterval!==t.debounceInterval||"throttleInterval"in e&&e.throttleInterval!==t.throttleInterval)&&this.updateDebounce()},t.prototype.updateOptions=function(t){var e=this.options,n=r(r({},this.options),t);this.options=n,this.afterUpdateOptions(e,n)},t.prototype._run=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.pollingTimer&&clearTimeout(this.pollingTimer);var r=this.counter;this.params=e;var o=this.options,i=o.cacheKey,u=o.cacheTime,c=o.persisted,a=o.formatResult,s=o.onSuccess,l=o.onError,f=o.onFinally,h=o.onBefore,p=o.pollingWhenHidden,d=o.pollingInterval;return null==h||h(e),new Promise(function(n,o){Z.run(function(){return t.async.apply(t,e).then(function(t){return"function"==typeof a?a(t,e):t})},i,{persisted:c,ttl:u}).then(function(o){r===t.counter&&(null==s||s(o,e),n(o))}).catch(function(n){r===t.counter&&(null==l||l(n,e),o(n))}).finally(function(){if(r===t.counter&&(null==f||f(),d)){if(!$()&&!p)return void(t.pollingWhenVisibleFlag=!0);t.pollingTimer=setTimeout(function(){t.run.apply(t,e)},d)}})})},t.prototype._wraprun=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.counter+=1,this._run.apply(this,t)},t.prototype.run=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.debounce?(this.debounce.apply(this,t),Promise.resolve(null)):this.throttle?(this.throttle.apply(this,t),Promise.resolve(null)):this._wraprun.apply(this,t)},t.prototype.refresh=function(){return this.run.apply(this,this.params)},t.prototype.cancel=function(){this.debounce&&this.debounce.cancel(),this.throttle&&this.throttle.cancel(),this.pollingTimer&&(clearTimeout(this.pollingTimer),this.pollingTimer=null),this.counter+=1},t.prototype.destroy=function(t){void 0===t&&(t=!0),t&&this.cancel(),this.destroyed||(this.destroyed=!0,this.unsubscribes.forEach(function(t){return t()}),this.unsubscribes=[])},t.prototype.resume=function(){this.destroyed&&(this.destroyed=!1,this.init())},t}(),nt=function(t,n){var o=n||{},i=o.autoRun,u=void 0===i||i,a=o.refreshDeps,s=void 0===a?[]:a,l=o.defaultParams,f=o.loadingDelay,p=o.__INTERNAL_FORMAT__,d=o.defaultLoading,v=o.initialData,y=o.cacheKey,g=void 0===y?"":y,m=o.cacheTime,b=void 0===m?3e5:m,w=o.persisted,k=void 0!==w&&w,T=o.onSuccess,E=void 0===T?x:T,C=o.onError,L=void 0===C?x:C,I=o.onFinally,R=void 0===I?x:I,P=o.onBefore,j=void 0===P?x:P,A=o.pollingInterval,M=void 0===A?0:A,W=o.pollingWhenHidden,z=void 0===W||W,K=o.refreshOnWindowFocus,H=void 0!==K&&K,U=o.focusTimespan,B=void 0===U?5e3:U,$=o.debounceInterval,J=o.throttleInterval,q=c(e.useState(function(){return{params:[],loading:!!(O(d)?u&&!f:d),error:null,data:g?tt(g):v}}),2),G=q[0],Y=q[1],Q=D(),X=e.useRef(null),Z=N(t),nt=N(E),rt=N(L),ot=N(R),it=N(j),ut=V(p),ct=e.useCallback(function(t){it(t),X.current&&clearTimeout(X.current),(g?tt(g):void 0)&&k||(Y(function(e){var n=!function(t,e,n){if(void 0===n&&(n=!0),S(t,e,n))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++){var u=r[i];if(!h.call(e,u)||!S(t[u],e[u],n))return!1}return!0}(e.params,t);return e.loading!==!f||n?r(r({},e),{loading:!f,params:t}):e}),f&&(X.current=setTimeout(function(){Q.current||Y(function(t){return r(r({},t),{loading:!0})})},f)))},[g,f,it,k,Q]),at=e.useCallback(function(t,e){X.current&&clearTimeout(X.current),Y(function(e){return r(r({},e),{data:t,error:null,loading:!1})}),nt(t,e)},[nt]),st=e.useCallback(function(t,e){X.current&&clearTimeout(X.current),Y(function(e){return r(r({},e),{error:t,loading:!1})}),rt(t,e)},[rt]),lt=e.useRef(void 0);lt.current||(lt.current=new et(Z,{cacheKey:g,cacheTime:b,persisted:k,formatResult:ut.current,onSuccess:at,onError:st,onFinally:ot,onBefore:ct,debounceInterval:$,throttleInterval:J,pollingInterval:M,pollingWhenHidden:z,refreshOnWindowFocus:H,focusTimespan:B})),F(function(){lt.current.updateOptions({cacheKey:g,cacheTime:b,persisted:k,formatResult:ut.current,onSuccess:at,onError:st,onFinally:ot,onBefore:ct,debounceInterval:$,throttleInterval:J,pollingInterval:M,pollingWhenHidden:z,refreshOnWindowFocus:H,focusTimespan:B})},[nt,rt,g,b,k,$,J,ot,it,M,z,H,B,at,st,ct]);var ft=e.useCallback(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return lt.current.run.apply(lt.current,t)},[]),ht=e.useCallback(function(){return lt.current.refresh()},[]),pt=e.useCallback(function(){lt.current.cancel(),X.current&&clearTimeout(X.current),Y(function(t){return r(r({},t),{loading:!1})})},[]);return F(function(){u&&_(s)&&s.length>0&&ht()},[u].concat(s)),e.useEffect(function(){if(u){var t=_(l)?l:void 0!==l?[l]:[];ft.apply(void 0,t)}return lt.current.resume(),function(){pt(),lt.current.destroy(!1)}},[]),r(r({},G),{run:ft,cancel:pt,mutate:function(t){Y("function"==typeof t?function(e){return r(r({},e),{data:t(G.data)})}:function(e){return r(r({},e),{data:t})})},refresh:ht})};function rt(t){return"function"==typeof t?t():t}var ot=function(t){var n=void 0===t?{}:t,r=n.target,o=n.threshold,i=void 0===o?100:o,u=n.onScrollLower,c=N(void 0===u?function(){}:u),a=e.useCallback(function(){if(r){var t,e=rt(r);if(e)void 0===(t=e)&&(t=window),(E&&t?P(t)?document.documentElement.scrollHeight:t.scrollHeight:0)-function(t){return void 0===t&&(t=window),E&&t?P(t)?window.scrollY:t.scrollTop:0}(e)<=function(t){return void 0===t&&(t=window),E&&t?P(t)?document.documentElement.clientHeight:t.clientHeight:0}(e)+i&&c()}},[c,r,i]);e.useEffect(function(){if(r){var t=rt(r);if(t)return t.addEventListener("scroll",a),function(){t.removeEventListener("scroll",a)}}},[r,a])};var it=function(t){var n=V(t);e.useEffect(function(){return function(){return n.current()}},[])};function ut(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var o=V(t),i=e.useRef(void 0);return i.current||(i.current=L(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.current.apply(void 0,t)},n,r)),it(function(){i.current.cancel()}),{run:i.current,cancel:i.current.cancel,flush:i.current.flush}}function ct(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!0);var o=V(t),i=e.useRef(void 0);return i.current||(i.current=R(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.current.apply(void 0,t)},n,r)),it(function(){i.current.cancel()}),{run:i.current,cancel:i.current.cancel,flush:i.current.flush}}var at=X+"_useCacheState";function st(t){return new U(at,{storage:t})}var lt=function(){var t=e.useRef(!1);return e.useEffect(function(){return t.current=!0,function(){t.current=!1}},[]),t};function ft(t){var n=D(),r=c(e.useState(t),2),o=r[0],i=r[1];return[o,e.useCallback(function(t){n.current||i(t)},[])]}function ht(t){return"function"==typeof t?t():"object"==typeof t&&t&&"current"in t?t.current:t}var pt=Object.prototype.hasOwnProperty;var dt=["top","right","bottom","left","width","height","size","weight"],vt={characterData:!0,childList:!0,attributes:!0,subtree:!0},yt=function(t){var e=this;this.refresh=function(){e.targetNode&&e.callback([{target:e.targetNode}],{})},this.onTransitionEnd_=function(t){var n=t.propertyName,r=void 0===n?"":n;dt.some(function(t){return r.indexOf(t)>-1})&&e.throttleRefresh()},this.observe=function(t,n){E&&(e.targetNode=t,document.addEventListener("transitionend",e.onTransitionEnd_),window.addEventListener("resize",e.throttleRefresh),e.observer.observe(document,r(r({},vt),n)))},this.disconnect=function(){E&&(e.throttleRefresh.cancel(),e.targetNode=null,document.removeEventListener("transitionend",e.onTransitionEnd_),window.removeEventListener("resize",e.throttleRefresh),e.observer.disconnect())},this.throttleRefresh=R(this.refresh,50),this.targetNode=null,this.callback=t,this.observer=new MutationObserver(this.throttleRefresh)};t.clearCache=function(t){t?Z.cache.del(t):Z.cache.clear()},t.clearCacheState=function(t,e){var n=st(t);e?n.del(e):n.clear()},t.useAsync=nt,t.useCacheState=function(t,n,r){void 0===r&&(r={});var o=r.ttl,i=r.storage,u=e.useMemo(function(){return st(i)},[i]),a=c(e.useState(function(){var e=u.get(t);return O(e)?n:e}),2),s=a[0],l=a[1];return[s,e.useCallback(function(e){l(function(n){var r=e instanceof Function?e(n):e;return u.set(t,r,o),r})},[u,t,o])]},t.useClickAway=function(t,n,r){void 0===r&&(r="click");var o=j(t),i=V(o),u=o.every(function(t){return"function"==typeof t}),c=u?i:o,a=V(n),s=j(r),l=V(s),f=s.join("");e.useEffect(function(){var t=function(t){var e;(u?c.current:c).some(function(e){var n=ht(e);return!n||(null==n?void 0:n.contains(t.target))})||null===(e=a.current)||void 0===e||e.call(a,t)},e=j(l.current);return e.forEach(function(e){document.addEventListener(e,t)}),function(){e.forEach(function(e){document.removeEventListener(e,t)})}},[c,u,f])},t.useControllableValue=function(t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=n.defaultValue,o=n.defaultValuePropName,i=void 0===o?"defaultValue":o,u=n.valuePropName,a=void 0===u?"value":u,s=n.trigger,l=void 0===s?"onChange":s,f=pt.call(t,a),h=c(e.useState(function(){return f?t[a]:pt.call(t,i)?t[i]:r}),2),p=h[0],d=h[1],v=e.useCallback(function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];f||d(e),t[l]&&t[l].apply(t,[e].concat(n))},[f,t,l]);return[f?t[a]:p,v]},t.useDebounce=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var o=c(e.useState(t),2),i=o[0],u=ut(o[1],n,r).run;return e.useEffect(function(){u(t)},[u,t]),i},t.useDebounceFn=ut,t.useLatest=V,t.useLimitList=function(t,n){void 0===n&&(n={});var r=n||{},o=r.count,i=void 0===o?3:o,u=r.defaultLimited,a=void 0===u||u,s=c(e.useState(a),2),l=s[0],f=s[1],h=e.useMemo(function(){return _(t)&&t.length>i?l?t.slice(0,i):t:t||[]},[l,t,i]);return{limited:l,canLimit:_(t)&&t.length>i,data:h,toggle:function(){f(!l)}}},t.useLoadMore=function(t,n){var a=this,s=n||{},l=s.threshold,f=void 0===l?100:l,h=s.target,p=s.isNoMore,d=void 0===p?function(){return!1}:p,v=s.refreshDeps,y=void 0===v?[]:v,g=s.autoRun,m=void 0===g||g,b=o(s,["threshold","target","isNoMore","refreshDeps","autoRun"]),w=e.useRef([]),k=e.useRef(1),T=nt(t,r(r({defaultParams:[{current:k.current}],autoRun:m},b),{onError:function(t,e){var n;k.current>1&&(k.current-=1),null===(n=null==b?void 0:b.onError)||void 0===n||n.call(b,t,e)},__INTERNAL_FORMAT__:function(t){return w.current=1===k.current?t.list:w.current.concat(t.list),r(r({},t),{list:w.current})}})),S=T.run,E=T.data,O=T.loading,C=T.cancel,L=T.params,I=T.mutate,R=o(T,["run","data","loading","cancel","params","mutate"]),P=!!d&&(!O&&d(E)),j=c(L||[]),x=j[0],V=j.slice(1),N=e.useCallback(function(){return S.apply(void 0,[{current:k.current}].concat(V))},[V,S]),D=e.useCallback(function(){O&&k.current>1&&(k.current-=1),C()},[C,O]),A=e.useCallback(function(){return i(a,void 0,void 0,function(){return u(this,function(t){return O||P?[2]:(k.current+=1,[2,N()])})})},[O,P,N]),M=e.useCallback(function(t){var e="function"==typeof t?t(E):t;w.current=(null==e?void 0:e.list)||[],I(e)},[E,I]),W=e.useCallback(function(){return D(),k.current=1,M(function(t){return r(r({},t),{list:[]})}),N()},[D,N,M]),z=e.useCallback(function(){if(!O&&h)return A()},[A,h,O]);return ot({target:h,threshold:f,onScrollLower:z}),F(function(){m&&_(y)&&y.length>0&&W()},y),r(r({},R),{loading:O,data:E,run:S,refresh:W,cancel:D,mutate:M,params:[r(r({},x),{current:k.current})].concat(V),loadMore:A,loadingMore:O&&k.current>1,noMore:P})},t.useMount=function(t){e.useEffect(function(){t()},[])},t.useMountedRef=lt,t.usePagination=function(t,n){var i=n||{},u=i.defaultPageSize,a=void 0===u?10:u,s=i.refreshDeps,l=void 0===s?[]:s,f=i.defaultParams,h=i.autoRun,p=void 0===h||h,d=o(i,["defaultPageSize","refreshDeps","defaultParams","autoRun"]),v=e.useMemo(function(){return f||[{current:1,pageSize:a}]},[a,f]),y=nt(t,r({defaultParams:v,autoRun:p},d)),g=y.run,m=y.data,b=y.params,w=y.loading,k=o(y,["run","data","params","loading"]),T=b&&b[0]?b[0]:v[0],S=T.current,E=T.pageSize,O=(null==m?void 0:m.total)||0,C=e.useCallback(function(t){var e=c(b),n=e[0],o=e.slice(1);return g.apply(void 0,[r(r({},n),t)].concat(o))},[b,g]),L=e.useCallback(function(){return C({current:S,pageSize:E})},[C,S,E]),I=e.useCallback(function(t,e){var n=t<=0?1:t,r=e<=0?1:e,o=Math.ceil(O/r);n>o&&o>0&&(n=o),C({current:n,pageSize:r})},[C,O]),R=e.useCallback(function(t){I(t,E)},[I,E]),P=e.useCallback(function(t){I(S,t)},[S,I]),j=e.useCallback(function(t,e,n,r){C({current:null==t?void 0:t.current,pageSize:null==t?void 0:t.pageSize,filters:e,sorter:n,extra:r})},[C]);return F(function(){p&&_(l)&&l.length>0&&R(1)},l),r(r({},k),{data:m,run:g,refresh:L,loading:w,params:b,pagination:{current:S,pageSize:E,total:O,onChange:I,changeCurrent:R,changePageSize:P},tableProps:{dataSource:(null==m?void 0:m.list)||[],loading:w,onChange:j,pagination:{total:O,current:S,pageSize:E}}})},t.usePersistFn=N,t.usePrevious=function(t){var n=lt(),r=e.useRef(void 0),o=e.useRef(t);return n.current&&o.current!==t&&(r.current=o.current,o.current=t),r.current},t.useSafeState=ft,t.useSetState=function(t){var n=c(e.useState(t),2),o=n[0],i=n[1];return[o,e.useCallback(function(t){i(function(e){var n=t instanceof Function?t(e):t;return n instanceof Object?r(r({},e),n):e})},[])]},t.useSize=function(t){var n=V(t),r=c(e.useState(function(){var e=ht(t);return{width:null==e?void 0:e.clientWidth,height:null==e?void 0:e.clientHeight}}),2),o=r[0],i=r[1],u=V(o);return e.useEffect(function(){var t=ht(n.current);function e(t){var e=null==t?void 0:t.clientWidth,n=null==t?void 0:t.clientHeight;e===u.current.width&&n===u.current.height||i({width:e,height:n})}if(!t)return function(){};e(t);var r=new yt(function(t){t.forEach(function(t){e(t.target)})});return r.observe(t),function(){r.disconnect()}},[n,u]),o},t.useThrottle=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!0);var o=c(e.useState(t),2),i=o[0],u=ct(o[1],n,r).run;return e.useEffect(function(){u(t)},[u,t]),i},t.useThrottleFn=ct,t.useUnmount=it,t.useUnmountedRef=D,t.useUpdate=function(){var t=c(ft(0),2)[1];return e.useCallback(function(){t(function(t){return t+1})},[])},t.useUpdateEffect=F,t.useUpdateLayoutEffect=function(t,n){var r=e.useRef(!1);e.useLayoutEffect(function(){if(r.current)return t();r.current=!0},n)}});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).rcHooks={},t.React)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function i(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}a((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var a=void 0,s="undefined",l=Object.prototype,f=l.toString,h=l.hasOwnProperty,p="[object ",d=p+"String]",v=p+"Symbol]",y=p+"Window]";function g(t){return null!==t&&"object"==typeof t}function m(t){return f.call(t)}var b=/^0b[01]+$/i,w=/^0o[0-7]+$/i,_=/^[-+]0x[0-9a-f]+$/i;function S(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||m(t)===v}(t))return NaN;if(function(t){return"function"==typeof t||g(t)}(t)&&(t=Number(t)),"string"!=typeof t)return 0===t?t:+t;t=t.trim();var e=b.test(t);return e||w.test(t)?parseInt(t.slice(2),e?2:8):_.test(t)?NaN:+t}function k(t){return Array.isArray(t)}function E(t,e,n){return void 0===n&&(n=!1),t===e?!n||(0!==t||1/t==1/e):t!=t&&e!=e}var T=typeof window!==s&&g(window)&&typeof document!==s&&g(document)&&window.document===document;m(function(){return arguments}());function O(t){return t===a}function C(t,e,n,r){if(void 0===r&&(r=!1),"function"!=typeof t)throw new TypeError("Expected a function");var o,i,u,c,s,l,f,h;function p(e){return u=e,l=t.apply(s,c),s=c=a,l}function d(){for(var t=[],f=0;f<arguments.length;f++)t[f]=arguments[f];s=this,c=t;var h=Date.now(),d=function(t){if(i===a)return!0;var n=t-i;return n>=e||n<0||r&&t-u>=e}(h),v=r?d||i===a||o!==a?e:e-(h-i):e;return i=h,d&&n&&o===a?p(h):(o===a||r||(clearTimeout(o),o=a),o===a&&(o=setTimeout((function(){o=a,p(Date.now())}),v)),l)}return f=S(e),h=0,e=null==f||f!=f?h:f,d.cancel=function(){o!==a&&(clearTimeout(o),o=a),i=o=c=s=a},d.flush=function(){return o!==a?(clearTimeout(o),o=a,p(Date.now())):l},d.pending=function(){return o!==a},d}function L(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=!1),C(t,e,n)}function R(t,e){var n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=!0,t.apply(void 0,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],c(r),!1)),setTimeout((function(){n=!1}),e))}}function I(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=!0),C(t,e,n,!0)}function P(t){return g(t)&&m(t)===y}function j(t){return arguments.length?k(t)?t:[t]:[]}function x(){}function D(t){var n=e.useRef(t);return n.current=t,n}function N(t){var n=D(t),r=e.useCallback((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=n.current;return null==r?void 0:r.apply(void 0,t)}),[]);return r}var V=function(t,n){var r=e.useRef(!1);e.useEffect((function(){if(r.current)return t();r.current=!0}),n)},F=function(){var t=e.useRef(!1);return e.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),t},A=function(){function t(){this.handlers={}}return t.prototype.eventNames=function(){var t,e=(null===(t=Object.getOwnPropertySymbols)||void 0===t?void 0:t.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(e)},t.prototype.rawListeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.raw})):[]},t.prototype.listeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.wrap})):[]},t.prototype.hasListener=function(t,e){return this.rawListeners(t).some((function(t){return t===e}))},t.prototype._on=function(t,e,n,r,o){void 0===r&&(r=null),void 0===o&&(o=1);var i={raw:e,wrap:n,context:r};if(this.handlers[t]){var u=1===o?"push":"unshift";this.handlers[t][u](i)}else this.handlers[t]=[i];return this},t.prototype.prependListener=function(t,e,n){return this._on(t,e,e,n,0)},t.prototype.on=function(t,e,n){return this._on(t,e,e,n)},t.prototype._wrapOnce=function(t,e,n){var r=this;void 0===n&&(n=null);var o=function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];e.apply(n,i),r.off(t,o)};return o},t.prototype.once=function(t,e,n){var r=this._wrapOnce(t,e,n);return this._on(t,e,r,n)},t.prototype.prependOnceListener=function(t,e,n){var r=this._wrapOnce(t,e,n);return this._on(t,e,r,n,0)},t.prototype.off=function(t,e){var n=this.handlers[t];if(n)if(e){var r=n.findIndex((function(t){return t.wrap===e||t.raw===e}));-1!==r&&n.splice(r,1)}else delete this.handlers[t];return this},t.prototype.offAll=function(){return this.handlers={},this},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=this.handlers[t];return!!(r&&r.length>0)&&(r.forEach((function(t){t.wrap.apply(t.context,e)})),!0)},t}(),M="cache2",W="".concat(M,"_"),z="default";var K={},H=function(){function t(t){void 0===t&&(t=z),this.scope=t,K[this.scope]||(K[this.scope]={}),this.data=K[this.scope]}return t.prototype.getItem=function(t){return t in this.data?this.data[t]:null},t.prototype.setItem=function(t,e){this.data[t]=e},t.prototype.removeItem=function(t){delete this.data[t]},t.prototype.clear=function(){K[this.scope]={},this.data=K[this.scope]},t}(),U=function(){function t(t,e){void 0===e&&(e={});var n=!!t&&function(t){try{var e="object"==typeof t&&null!==t&&!!t.setItem&&!!t.getItem&&!!t.removeItem;if(e){var n=Math.random().toString(16).substring(2,8),r="___".concat(M,"_test_").concat(n,"_").concat(Date.now(),"___");t.setItem(r,"1"),t.removeItem(r)}return e}catch(t){return console.error("[".concat(M,"] Storage operation failed:"),t instanceof Error?t.message:t),console.warn("[".concat(M,"] The default memory cache will be used.")),!1}}(t);this.options=r({needParsed:n,prefix:""},e),this.storage=n?t:new H(this.options.memoryScope)}return t.prototype.getKey=function(t){return this.options.prefix+t},t.prototype.get=function(t){var e=this.storage.getItem(this.getKey(t));return this.options.needParsed?function(t,e){try{return JSON.parse(t,e)}catch(e){return console.warn("[".concat(M,"] JSON parse failed, returning original value:"),e instanceof Error?e.message:e),t}}(e,this.options.reviver):e},t.prototype.set=function(t,e){this.storage.setItem(this.getKey(t),this.options.needParsed?function(t,e){try{return JSON.stringify(t,e)}catch(t){throw console.error("[".concat(M,"] JSON stringify failed:"),t instanceof Error?t.message:t),t}}(e,this.options.replacer):e)},t.prototype.del=function(t){this.storage.removeItem(this.getKey(t))},t.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},t}(),B=function(t){function e(e,n){var o,i=t.call(this)||this,u=z;return"string"==typeof e?u=e||z:"object"==typeof e&&(o=e),o||"object"!=typeof n||(o=n),i.options=r({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:W},o),i.storage=new U(i.options.storage,r({memoryScope:u},i.options)),i.cacheKey=u,i.startCheckperiod(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._check=function(t,e){var n=!0;return 0!==e.t&&e.t<Date.now()&&(n=!1,this.del(t),this.emit("expired",t,e.v)),n},e.prototype._wrap=function(t,e){var n=Date.now(),r="number"==typeof e?e:this.options.stdTTL;return{v:t,t:r>0?n+r:0,n:n}},e.prototype._isLimited=function(t){return this.options.max>-1&&t>=this.options.max},e.prototype._getReplaceKey=function(t,e){var n=t[0];return t.forEach((function(t){e[n].n>e[t].n&&(n=t)})),n},Object.defineProperty(e.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),e.prototype.setCacheValues=function(t){this.storage.set(this.cacheKey,t)},e.prototype._getData=function(t,e){var n=e[t];if(n&&this._check(t,n))return n},e.prototype.get=function(t){var e=this._getData(t,this.cacheValues);return null==e?void 0:e.v},e.prototype.mget=function(t){var e=this,n={};if(!Array.isArray(t))return n;var r=this.cacheValues;return t.forEach((function(t){var o=e._getData(t,r);o&&(n[t]=o.v)})),n},e.prototype.getAll=function(){var t=Object.keys(this.cacheValues);return this.mget(t)},e.prototype.set=function(t,e,n){if(0===this.options.max)return!1;var r=this.cacheValues,o=Object.keys(r);if(!r[t]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var u=this._getReplaceKey(i,r);this.del(u)}}return r[t]=this._wrap(e,n),this.setCacheValues(r),this.emit("set",t,r[t].v),!0},e.prototype.mset=function(t){var e=this,n=!0;return t.forEach((function(t){var r=e.set(t.key,t.value,t.ttl);n&&!r&&(n=!1)})),n},e.prototype.del=function(t){var e=this,n=this.cacheValues,r=0;return(Array.isArray(t)?t:[t]).forEach((function(t){if(n[t]){r++;var o=n[t];delete n[t],e.emit("del",t,o.v)}})),r>0&&this.setCacheValues(n),r},e.prototype.clear=function(){this.storage.del(this.cacheKey)},e.prototype.keys=function(){var t=this,e=this.cacheValues;return Object.keys(e).filter((function(n){return t._check(n,e[n])}))},e.prototype.has=function(t){return!!this._getData(t,this.cacheValues)},e.prototype.take=function(t){var e,n=this._getData(t,this.cacheValues);return n&&(e=n.v,this.del(t)),e},e.prototype.ttl=function(t,e){var n=this._getData(t,this.cacheValues);return!!n&&this.set(t,n.v,e)},e.prototype.getTtl=function(t){var e=this._getData(t,this.cacheValues);return null==e?void 0:e.t},e.prototype.getLastModified=function(t){var e=this._getData(t,this.cacheValues);return null==e?void 0:e.n},e.prototype.startCheckperiod=function(){var t=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout((function(){t.startCheckperiod()}),this.options.checkperiod))},e.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},e}(A),J=function(){function t(t,e){void 0===e&&(e="uh_async_memo"),this.promiseCache={},this.cache=new B(e,t)}return t.prototype.run=function(t,e,n){var o,i=this;if(!e||"string"!=typeof(o=e)&&m(o)!==d)return t();var u=r({persisted:!0},n);if(u.persisted){var c=this.cache.get(e);if(c)return Promise.resolve(c)}return this.promiseCache[e]||(this.promiseCache[e]=t().then((function(t){return delete i.promiseCache[e],i.cache.set(e,t,u.ttl),t})).catch((function(t){return delete i.promiseCache[e],Promise.reject(t)}))),this.promiseCache[e]},t}();function $(){return"undefined"==typeof document||void 0===document.visibilityState||"hidden"!==document.visibilityState}var q=[];var G=!1;if("undefined"!=typeof window&&window.addEventListener&&!G){window.addEventListener("visibilitychange",(function(){if($())for(var t=0;t<q.length;t++){(0,q[t])()}}),!1),G=!0}var Y=[];var Q=!1;if("undefined"!=typeof window&&window.addEventListener&&!Q){var X=function(){if($()&&("undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine))for(var t=0;t<Y.length;t++){(0,Y[t])()}};window.addEventListener("visibilitychange",X,!1),window.addEventListener("focus",X,!1),Q=!0}var Z="rc-hooks",tt=new J({prefix:Z,stdTTL:3e5});function et(t){return tt.cache.get(t)}var nt=function(){function t(t,e){this.params=[],this.pollingWhenVisibleFlag=!1,this.pollingTimer=null,this.counter=1,this.destroyed=!1,this.async=t,this.options=r({cacheTime:3e5,persisted:!1,pollingWhenHidden:!0,refreshOnWindowFocus:!1,focusTimespan:5e3},e),this.unsubscribes=[],this.init()}return t.prototype.init=function(){var t,e=this.options,n=e.pollingInterval,r=e.refreshOnWindowFocus,o=e.focusTimespan;if(this.updateDebounce(),n&&this.unsubscribes.push((t=this.rePolling.bind(this),q.push(t),function(){var e=q.indexOf(t);q.splice(e,1)})),r){var i=R(this.refresh.bind(this),o);this.unsubscribes.push(function(t){return Y.push(t),function(){var e=Y.indexOf(t);Y.splice(e,1)}}(i))}},t.prototype.updateDebounce=function(){var t=this.options,e=t.debounceInterval,n=t.throttleInterval;this.debounce="number"==typeof e&&e>0?L(this._wraprun,e):void 0,this.throttle="number"==typeof n&&n>0?I(this._wraprun,n):void 0},t.prototype.rePolling=function(){this.pollingWhenVisibleFlag&&(this.pollingWhenVisibleFlag=!1,this.refresh())},t.prototype.afterUpdateOptions=function(t,e){void 0===e&&(e={}),("debounceInterval"in e&&e.debounceInterval!==t.debounceInterval||"throttleInterval"in e&&e.throttleInterval!==t.throttleInterval)&&this.updateDebounce()},t.prototype.updateOptions=function(t){var e=this.options,n=r(r({},this.options),t);this.options=n,this.afterUpdateOptions(e,n)},t.prototype._run=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.pollingTimer&&clearTimeout(this.pollingTimer);var r=this.counter;this.params=e;var o=this.options,i=o.cacheKey,u=o.cacheTime,c=o.persisted,a=o.formatResult,s=o.onSuccess,l=o.onError,f=o.onFinally,h=o.onBefore,p=o.pollingWhenHidden,d=o.pollingInterval;return null==h||h(e),new Promise((function(n,o){tt.run((function(){return t.async.apply(t,e).then((function(t){return"function"==typeof a?a(t,e):t}))}),i,{persisted:c,ttl:u}).then((function(o){r===t.counter&&(null==s||s(o,e),n(o))})).catch((function(n){r===t.counter&&(null==l||l(n,e),o(n))})).finally((function(){if(r===t.counter&&(null==f||f(),d)){if(!$()&&!p)return void(t.pollingWhenVisibleFlag=!0);t.pollingTimer=setTimeout((function(){t.run.apply(t,e)}),d)}}))}))},t.prototype._wraprun=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.counter+=1,this._run.apply(this,t)},t.prototype.run=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.debounce?(this.debounce.apply(this,t),Promise.resolve(null)):this.throttle?(this.throttle.apply(this,t),Promise.resolve(null)):this._wraprun.apply(this,t)},t.prototype.refresh=function(){return this.run.apply(this,this.params)},t.prototype.cancel=function(){this.debounce&&this.debounce.cancel(),this.throttle&&this.throttle.cancel(),this.pollingTimer&&(clearTimeout(this.pollingTimer),this.pollingTimer=null),this.counter+=1},t.prototype.destroy=function(t){void 0===t&&(t=!0),t&&this.cancel(),this.destroyed||(this.destroyed=!0,this.unsubscribes.forEach((function(t){return t()})),this.unsubscribes=[])},t.prototype.resume=function(){this.destroyed&&(this.destroyed=!1,this.init())},t}(),rt=function(t,n){var o=n||{},i=o.autoRun,u=void 0===i||i,a=o.refreshDeps,s=void 0===a?[]:a,l=o.defaultParams,f=o.loadingDelay,p=o.__INTERNAL_FORMAT__,d=o.defaultLoading,v=o.initialData,y=o.cacheKey,g=void 0===y?"":y,m=o.cacheTime,b=void 0===m?3e5:m,w=o.persisted,_=void 0!==w&&w,S=o.onSuccess,T=void 0===S?x:S,C=o.onError,L=void 0===C?x:C,R=o.onFinally,I=void 0===R?x:R,P=o.onBefore,j=void 0===P?x:P,A=o.pollingInterval,M=void 0===A?0:A,W=o.pollingWhenHidden,z=void 0===W||W,K=o.refreshOnWindowFocus,H=void 0!==K&&K,U=o.focusTimespan,B=void 0===U?5e3:U,J=o.debounceInterval,$=o.throttleInterval,q=c(e.useState((function(){return{params:[],loading:!!(O(d)?u&&!f:d),error:null,data:g?et(g):v}})),2),G=q[0],Y=q[1],Q=F(),X=e.useRef(null),Z=N(t),tt=N(T),rt=N(L),ot=N(I),it=N(j),ut=D(p),ct=e.useCallback((function(t){it(t),X.current&&clearTimeout(X.current),(g?et(g):void 0)&&_||(Y((function(e){var n=!function(t,e,n){if(void 0===n&&(n=!0),E(t,e,n))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++){var u=r[i];if(!h.call(e,u)||!E(t[u],e[u],n))return!1}return!0}(e.params,t);return e.loading!==!f||n?r(r({},e),{loading:!f,params:t}):e})),f&&(X.current=setTimeout((function(){Q.current||Y((function(t){return r(r({},t),{loading:!0})}))}),f)))}),[g,f,it,_,Q]),at=e.useCallback((function(t,e){X.current&&clearTimeout(X.current),Y((function(e){return r(r({},e),{data:t,error:null,loading:!1})})),tt(t,e)}),[tt]),st=e.useCallback((function(t,e){X.current&&clearTimeout(X.current),Y((function(e){return r(r({},e),{error:t,loading:!1})})),rt(t,e)}),[rt]),lt=e.useRef(void 0);lt.current||(lt.current=new nt(Z,{cacheKey:g,cacheTime:b,persisted:_,formatResult:ut.current,onSuccess:at,onError:st,onFinally:ot,onBefore:ct,debounceInterval:J,throttleInterval:$,pollingInterval:M,pollingWhenHidden:z,refreshOnWindowFocus:H,focusTimespan:B})),V((function(){lt.current.updateOptions({cacheKey:g,cacheTime:b,persisted:_,formatResult:ut.current,onSuccess:at,onError:st,onFinally:ot,onBefore:ct,debounceInterval:J,throttleInterval:$,pollingInterval:M,pollingWhenHidden:z,refreshOnWindowFocus:H,focusTimespan:B})}),[tt,rt,g,b,_,J,$,ot,it,M,z,H,B,at,st,ct]);var ft=e.useCallback((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return lt.current.run.apply(lt.current,t)}),[]),ht=e.useCallback((function(){return lt.current.refresh()}),[]),pt=e.useCallback((function(){lt.current.cancel(),X.current&&clearTimeout(X.current),Y((function(t){return r(r({},t),{loading:!1})}))}),[]);return V((function(){u&&k(s)&&s.length>0&&ht()}),[u].concat(s)),e.useEffect((function(){if(u){var t=k(l)?l:void 0!==l?[l]:[];ft.apply(void 0,t)}return lt.current.resume(),function(){pt(),lt.current.destroy(!1)}}),[]),r(r({},G),{run:ft,cancel:pt,mutate:function(t){Y("function"==typeof t?function(e){return r(r({},e),{data:t(G.data)})}:function(e){return r(r({},e),{data:t})})},refresh:ht})};function ot(t){return"function"==typeof t?t():t}var it=function(t){var n=void 0===t?{}:t,r=n.target,o=n.threshold,i=void 0===o?100:o,u=n.onScrollLower,c=N(void 0===u?function(){}:u),a=e.useCallback((function(){if(r){var t,e=ot(r);if(e)void 0===(t=e)&&(t=window),(T&&t?P(t)?document.documentElement.scrollHeight:t.scrollHeight:0)-function(t){return void 0===t&&(t=window),T&&t?P(t)?window.scrollY:t.scrollTop:0}(e)<=function(t){return void 0===t&&(t=window),T&&t?P(t)?document.documentElement.clientHeight:t.clientHeight:0}(e)+i&&c()}}),[c,r,i]);e.useEffect((function(){if(r){var t=ot(r);if(t)return t.addEventListener("scroll",a),function(){t.removeEventListener("scroll",a)}}}),[r,a])};var ut=function(t){var n=D(t);e.useEffect((function(){return function(){return n.current()}}),[])};function ct(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var o=D(t),i=e.useRef(void 0);return i.current||(i.current=L((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.current.apply(void 0,t)}),n,r)),ut((function(){i.current.cancel()})),{run:i.current,cancel:i.current.cancel,flush:i.current.flush}}function at(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!0);var o=D(t),i=e.useRef(void 0);return i.current||(i.current=I((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.current.apply(void 0,t)}),n,r)),ut((function(){i.current.cancel()})),{run:i.current,cancel:i.current.cancel,flush:i.current.flush}}var st=Z+"_useCacheState";function lt(t){return new B(st,{storage:t})}var ft=function(){var t=e.useRef(!1);return e.useEffect((function(){return t.current=!0,function(){t.current=!1}}),[]),t};function ht(t){var n=F(),r=c(e.useState(t),2),o=r[0],i=r[1];return[o,e.useCallback((function(t){n.current||i(t)}),[])]}function pt(t){return"function"==typeof t?t():"object"==typeof t&&t&&"current"in t?t.current:t}var dt=Object.prototype.hasOwnProperty;var vt=["top","right","bottom","left","width","height","size","weight"],yt={characterData:!0,childList:!0,attributes:!0,subtree:!0},gt=function(t){var e=this;this.refresh=function(){e.targetNode&&e.callback([{target:e.targetNode}],{})},this.onTransitionEnd_=function(t){var n=t.propertyName,r=void 0===n?"":n;vt.some((function(t){return r.indexOf(t)>-1}))&&e.throttleRefresh()},this.observe=function(t,n){T&&(e.targetNode=t,document.addEventListener("transitionend",e.onTransitionEnd_),window.addEventListener("resize",e.throttleRefresh),e.observer.observe(document,r(r({},yt),n)))},this.disconnect=function(){T&&(e.throttleRefresh.cancel(),e.targetNode=null,document.removeEventListener("transitionend",e.onTransitionEnd_),window.removeEventListener("resize",e.throttleRefresh),e.observer.disconnect())},this.throttleRefresh=I(this.refresh,50),this.targetNode=null,this.callback=t,this.observer=new MutationObserver(this.throttleRefresh)};t.clearCache=function(t){t?tt.cache.del(t):tt.cache.clear()},t.clearCacheState=function(t,e){var n=lt(t);e?n.del(e):n.clear()},t.useAsync=rt,t.useCacheState=function(t,n,r){void 0===r&&(r={});var o=r.ttl,i=r.storage,u=e.useMemo((function(){return lt(i)}),[i]),a=c(e.useState((function(){var e=u.get(t);return O(e)?n:e})),2),s=a[0],l=a[1];return[s,e.useCallback((function(e){l((function(n){var r=e instanceof Function?e(n):e;return u.set(t,r,o),r}))}),[u,t,o])]},t.useClickAway=function(t,n,r){void 0===r&&(r="click");var o=j(t),i=D(o),u=o.every((function(t){return"function"==typeof t})),c=u?i:o,a=D(n),s=j(r),l=D(s),f=s.join("");e.useEffect((function(){var t=function(t){var e;(u?c.current:c).some((function(e){var n=pt(e);return!n||(null==n?void 0:n.contains(t.target))}))||null===(e=a.current)||void 0===e||e.call(a,t)},e=j(l.current);return e.forEach((function(e){document.addEventListener(e,t)})),function(){e.forEach((function(e){document.removeEventListener(e,t)}))}}),[c,u,f])},t.useControllableValue=function(t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=n.defaultValue,o=n.defaultValuePropName,i=void 0===o?"defaultValue":o,u=n.valuePropName,a=void 0===u?"value":u,s=n.trigger,l=void 0===s?"onChange":s,f=dt.call(t,a),h=c(e.useState((function(){return f?t[a]:dt.call(t,i)?t[i]:r})),2),p=h[0],d=h[1],v=e.useCallback((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];f||d(e),t[l]&&t[l].apply(t,[e].concat(n))}),[f,t,l]);return[f?t[a]:p,v]},t.useDebounce=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var o=c(e.useState(t),2),i=o[0],u=ct(o[1],n,r).run;return e.useEffect((function(){u(t)}),[u,t]),i},t.useDebounceFn=ct,t.useLatest=D,t.useLimitList=function(t,n){void 0===n&&(n={});var r=n||{},o=r.count,i=void 0===o?3:o,u=r.defaultLimited,a=void 0===u||u,s=c(e.useState(a),2),l=s[0],f=s[1],h=e.useMemo((function(){return k(t)&&t.length>i?l?t.slice(0,i):t:t||[]}),[l,t,i]);return{limited:l,canLimit:k(t)&&t.length>i,data:h,toggle:function(){f(!l)}}},t.useLoadMore=function(t,n){var a=this,s=n||{},l=s.threshold,f=void 0===l?100:l,h=s.target,p=s.isNoMore,d=void 0===p?function(){return!1}:p,v=s.refreshDeps,y=void 0===v?[]:v,g=s.autoRun,m=void 0===g||g,b=o(s,["threshold","target","isNoMore","refreshDeps","autoRun"]),w=e.useRef([]),_=e.useRef(1),S=rt(t,r(r({defaultParams:[{current:_.current}],autoRun:m},b),{onError:function(t,e){var n;_.current>1&&(_.current-=1),null===(n=null==b?void 0:b.onError)||void 0===n||n.call(b,t,e)},__INTERNAL_FORMAT__:function(t){return w.current=1===_.current?t.list:w.current.concat(t.list),r(r({},t),{list:w.current})}})),E=S.run,T=S.data,O=S.loading,C=S.cancel,L=S.params,R=S.mutate,I=o(S,["run","data","loading","cancel","params","mutate"]),P=!!d&&(!O&&d(T)),j=c(L||[]),x=j[0],D=j.slice(1),N=e.useCallback((function(){return E.apply(void 0,[{current:_.current}].concat(D))}),[D,E]),F=e.useCallback((function(){O&&_.current>1&&(_.current-=1),C()}),[C,O]),A=e.useCallback((function(){return i(a,void 0,void 0,(function(){return u(this,(function(t){return O||P?[2]:(_.current+=1,[2,N()])}))}))}),[O,P,N]),M=e.useCallback((function(t){var e="function"==typeof t?t(T):t;w.current=(null==e?void 0:e.list)||[],R(e)}),[T,R]),W=e.useCallback((function(){return F(),_.current=1,M((function(t){return r(r({},t),{list:[]})})),N()}),[F,N,M]),z=e.useCallback((function(){if(!O&&h)return A()}),[A,h,O]);return it({target:h,threshold:f,onScrollLower:z}),V((function(){m&&k(y)&&y.length>0&&W()}),y),r(r({},I),{loading:O,data:T,run:E,refresh:W,cancel:F,mutate:M,params:[r(r({},x),{current:_.current})].concat(D),loadMore:A,loadingMore:O&&_.current>1,noMore:P})},t.useMount=function(t){e.useEffect((function(){t()}),[])},t.useMountedRef=ft,t.usePagination=function(t,n){var i=n||{},u=i.defaultPageSize,a=void 0===u?10:u,s=i.refreshDeps,l=void 0===s?[]:s,f=i.defaultParams,h=i.autoRun,p=void 0===h||h,d=o(i,["defaultPageSize","refreshDeps","defaultParams","autoRun"]),v=e.useMemo((function(){return f||[{current:1,pageSize:a}]}),[a,f]),y=rt(t,r({defaultParams:v,autoRun:p},d)),g=y.run,m=y.data,b=y.params,w=y.loading,_=o(y,["run","data","params","loading"]),S=b&&b[0]?b[0]:v[0],E=S.current,T=S.pageSize,O=(null==m?void 0:m.total)||0,C=e.useCallback((function(t){var e=c(b),n=e[0],o=e.slice(1);return g.apply(void 0,[r(r({},n),t)].concat(o))}),[b,g]),L=e.useCallback((function(){return C({current:E,pageSize:T})}),[C,E,T]),R=e.useCallback((function(t,e){var n=t<=0?1:t,r=e<=0?1:e,o=Math.ceil(O/r);n>o&&o>0&&(n=o),C({current:n,pageSize:r})}),[C,O]),I=e.useCallback((function(t){R(t,T)}),[R,T]),P=e.useCallback((function(t){R(E,t)}),[E,R]),j=e.useCallback((function(t,e,n,r){C({current:null==t?void 0:t.current,pageSize:null==t?void 0:t.pageSize,filters:e,sorter:n,extra:r})}),[C]);return V((function(){p&&k(l)&&l.length>0&&I(1)}),l),r(r({},_),{data:m,run:g,refresh:L,loading:w,params:b,pagination:{current:E,pageSize:T,total:O,onChange:R,changeCurrent:I,changePageSize:P},tableProps:{dataSource:(null==m?void 0:m.list)||[],loading:w,onChange:j,pagination:{total:O,current:E,pageSize:T}}})},t.usePersistFn=N,t.usePrevious=function(t){var n=ft(),r=e.useRef(void 0),o=e.useRef(t);return n.current&&o.current!==t&&(r.current=o.current,o.current=t),r.current},t.useSafeState=ht,t.useSetState=function(t){var n=c(e.useState(t),2),o=n[0],i=n[1];return[o,e.useCallback((function(t){i((function(e){var n=t instanceof Function?t(e):t;return n instanceof Object?r(r({},e),n):e}))}),[])]},t.useSize=function(t){var n=D(t),r=c(e.useState((function(){var e=pt(t);return{width:null==e?void 0:e.clientWidth,height:null==e?void 0:e.clientHeight}})),2),o=r[0],i=r[1],u=D(o);return e.useEffect((function(){var t=pt(n.current);function e(t){var e=null==t?void 0:t.clientWidth,n=null==t?void 0:t.clientHeight;e===u.current.width&&n===u.current.height||i({width:e,height:n})}if(!t)return function(){};e(t);var r=new gt((function(t){t.forEach((function(t){e(t.target)}))}));return r.observe(t),function(){r.disconnect()}}),[n,u]),o},t.useThrottle=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=!0);var o=c(e.useState(t),2),i=o[0],u=at(o[1],n,r).run;return e.useEffect((function(){u(t)}),[u,t]),i},t.useThrottleFn=at,t.useUnmount=ut,t.useUnmountedRef=F,t.useUpdate=function(){var t=c(ht(0),2)[1];return e.useCallback((function(){t((function(t){return t+1}))}),[])},t.useUpdateEffect=V,t.useUpdateLayoutEffect=function(t,n){var r=e.useRef(!1);e.useLayoutEffect((function(){if(r.current)return t();r.current=!0}),n)}}));
//# sourceMappingURL=rcHooks.min.js.map
{
"name": "rc-hooks",
"version": "3.3.0",
"version": "3.3.1",
"description": "React Hooks Library.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -80,3 +80,3 @@ import { clearCache, Options, AsyncFunction } from './Async';

interface UseAsync {
<R = any, P extends any[] = any[]>(asyncFn: AsyncFunction<R, P>, options?: Omit<AsyncOptions<R, P>, 'debounceInterval' | 'throttleInterval'> & ({
<R = any, P extends any[] = any[]>(asyncFn: AsyncFunction<R, P>, options: Omit<AsyncOptions<R, P>, 'debounceInterval' | 'throttleInterval'> & ({
debounceInterval: number;

@@ -101,3 +101,3 @@ } | {

};
<R = any, P extends any[] = any[]>(asyncFn: AsyncFunction<R, P>, options?: Omit<AsyncOptions<R, P>, 'debounceInterval' | 'throttleInterval'>): AsyncReturn<R, P>;
<R = any, P extends any[] = any[]>(asyncFn: AsyncFunction<R, P>, options?: AsyncOptions<R, P>): AsyncReturn<R, P>;
}

@@ -104,0 +104,0 @@ /**

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display