New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@airma/react-effect

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@airma/react-effect - npm Package Compare versions

Comparing version 15.1.3 to 15.1.4

2

dist/index.js

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

!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@airma/react-state")):"function"==typeof define&&define.amd?define(["react","@airma/react-state"],r):"object"==typeof exports?exports["@airma/react-effect"]=r(require("react"),require("@airma/react-state")):t["@airma/react-effect"]=r(t.react,t["@airma/react-state"])}(self,(function(t,r){return function(){var n={4933:function(t,r,n){var e=n(6291),o=n(7073),i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not a function")}},8209:function(t,r,n){var e=n(1814),o=n(7073),i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not a constructor")}},9076:function(t,r,n){var e=n(6291),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||e(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},2814:function(t,r,n){var e=n(6282),o=TypeError;t.exports=function(t,r){if(e(r,t))return t;throw o("Incorrect invocation")}},4905:function(t,r,n){var e=n(2366),o=String,i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not an object")}},5029:function(t,r,n){var e=n(678),o=n(6971),i=n(4821),u=function(t){return function(r,n,u){var c,a=e(r),f=i(a),s=o(u,f);if(t&&n!=n){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},9020:function(t,r,n){"use strict";var e=n(5061);t.exports=function(t,r){var n=[][t];return!!n&&e((function(){n.call(null,r||function(){return 1},1)}))}},2040:function(t,r,n){var e=n(4933),o=n(7615),i=n(2901),u=n(4821),c=TypeError,a=function(t){return function(r,n,a,f){e(n);var s=o(r),p=i(s),v=u(s),l=t?v-1:0,y=t?-1:1;if(a<2)for(;;){if(l in p){f=p[l],l+=y;break}if(l+=y,t?l<0:v<=l)throw c("Reduce of empty array with no initial value")}for(;t?l>=0:v>l;l+=y)l in p&&(f=n(f,p[l],l,s));return f}};t.exports={left:a(!1),right:a(!0)}},650:function(t,r,n){var e=n(936);t.exports=e([].slice)},3165:function(t,r,n){var e=n(6802)("iterator"),o=!1;try{var i=0,u={next:function(){return{done:!!i++}},return:function(){o=!0}};u[e]=function(){return this},Array.from(u,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!o)return!1;var n=!1;try{var i={};i[e]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},5489:function(t,r,n){var e=n(936),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},486:function(t,r,n){var e=n(8171),o=n(6291),i=n(5489),u=n(6802)("toStringTag"),c=Object,a="Arguments"==i(function(){return arguments}());t.exports=e?i:function(t){var r,n,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,r){try{return t[r]}catch(t){}}(r=c(t),u))?n:a?i(r):"Object"==(e=i(r))&&o(r.callee)?"Arguments":e}},6810:function(t,r,n){var e=n(8382),o=n(2466),i=n(8117),u=n(6462);t.exports=function(t,r,n){for(var c=o(r),a=u.f,f=i.f,s=0;s<c.length;s++){var p=c[s];e(t,p)||n&&e(n,p)||a(t,p,f(r,p))}}},430:function(t,r,n){var e=n(1502),o=n(6462),i=n(6034);t.exports=e?function(t,r,n){return o.f(t,r,i(1,n))}:function(t,r,n){return t[r]=n,t}},6034:function(t){t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},5850:function(t,r,n){var e=n(6291),o=n(6462),i=n(7192),u=n(1756);t.exports=function(t,r,n,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:r;if(e(n)&&i(n,f,c),c.global)a?t[r]=n:u(r,n);else{try{c.unsafe?t[r]&&(a=!0):delete t[r]}catch(t){}a?t[r]=n:o.f(t,r,{value:n,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},1756:function(t,r,n){var e=n(5001),o=Object.defineProperty;t.exports=function(t,r){try{o(e,t,{value:r,configurable:!0,writable:!0})}catch(n){e[t]=r}return r}},1502:function(t,r,n){var e=n(5061);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},5178:function(t){var r="object"==typeof document&&document.all,n=void 0===r&&void 0!==r;t.exports={all:r,IS_HTMLDDA:n}},6009:function(t,r,n){var e=n(5001),o=n(2366),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},6837:function(t,r,n){var e=n(5065),o=n(566);t.exports=!e&&!o&&"object"==typeof window&&"object"==typeof document},5065:function(t){t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},1368:function(t,r,n){var e=n(9966),o=n(5001);t.exports=/ipad|iphone|ipod/i.test(e)&&void 0!==o.Pebble},311:function(t,r,n){var e=n(9966);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(e)},566:function(t,r,n){var e=n(5489),o=n(5001);t.exports="process"==e(o.process)},4832:function(t,r,n){var e=n(9966);t.exports=/web0s(?!.*chrome)/i.test(e)},9966:function(t,r,n){var e=n(3425);t.exports=e("navigator","userAgent")||""},2821:function(t,r,n){var e,o,i=n(5001),u=n(9966),c=i.process,a=i.Deno,f=c&&c.versions||a&&a.version,s=f&&f.v8;s&&(o=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},2089:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9638:function(t,r,n){var e=n(5001),o=n(8117).f,i=n(430),u=n(5850),c=n(1756),a=n(6810),f=n(1092);t.exports=function(t,r){var n,s,p,v,l,y=t.target,d=t.global,h=t.stat;if(n=d?e:h?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in r){if(v=r[s],p=t.dontCallGetSet?(l=o(n,s))&&l.value:n[s],!f(d?s:y+(h?".":"#")+s,t.forced)&&void 0!==p){if(typeof v==typeof p)continue;a(v,p)}(t.sham||p&&p.sham)&&i(v,"sham",!0),u(n,s,v,t)}}},5061:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},5494:function(t,r,n){var e=n(8483),o=Function.prototype,i=o.apply,u=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(e?u.bind(i):function(){return u.apply(i,arguments)})},9918:function(t,r,n){var e=n(1017),o=n(4933),i=n(8483),u=e(e.bind);t.exports=function(t,r){return o(t),void 0===r?t:i?u(t,r):function(){return t.apply(r,arguments)}}},8483:function(t,r,n){var e=n(5061);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},3927:function(t,r,n){var e=n(8483),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},9873:function(t,r,n){var e=n(1502),o=n(8382),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},1017:function(t,r,n){var e=n(5489),o=n(936);t.exports=function(t){if("Function"===e(t))return o(t)}},936:function(t,r,n){var e=n(8483),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},3425:function(t,r,n){var e=n(5001),o=n(6291),i=function(t){return o(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?i(e[t]):e[t]&&e[t][r]}},6354:function(t,r,n){var e=n(486),o=n(3815),i=n(860),u=n(501),c=n(6802)("iterator");t.exports=function(t){if(!i(t))return o(t,c)||o(t,"@@iterator")||u[e(t)]}},8437:function(t,r,n){var e=n(3927),o=n(4933),i=n(4905),u=n(7073),c=n(6354),a=TypeError;t.exports=function(t,r){var n=arguments.length<2?c(t):r;if(o(n))return i(e(n,t));throw a(u(t)+" is not iterable")}},3815:function(t,r,n){var e=n(4933),o=n(860);t.exports=function(t,r){var n=t[r];return o(n)?void 0:e(n)}},5001:function(t,r,n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8382:function(t,r,n){var e=n(936),o=n(7615),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},2499:function(t){t.exports={}},3455:function(t,r,n){var e=n(5001);t.exports=function(t,r){var n=e.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,r))}},2118:function(t,r,n){var e=n(3425);t.exports=e("document","documentElement")},7788:function(t,r,n){var e=n(1502),o=n(5061),i=n(6009);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},2901:function(t,r,n){var e=n(936),o=n(5061),i=n(5489),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):u(t)}:u},685:function(t,r,n){var e=n(936),o=n(6291),i=n(9982),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},684:function(t,r,n){var e,o,i,u=n(1899),c=n(5001),a=n(2366),f=n(430),s=n(8382),p=n(9982),v=n(1695),l=n(2499),y="Object already initialized",d=c.TypeError,h=c.WeakMap;if(u||p.state){var b=p.state||(p.state=new h);b.get=b.get,b.has=b.has,b.set=b.set,e=function(t,r){if(b.has(t))throw d(y);return r.facade=t,b.set(t,r),r},o=function(t){return b.get(t)||{}},i=function(t){return b.has(t)}}else{var g=v("state");l[g]=!0,e=function(t,r){if(s(t,g))throw d(y);return r.facade=t,f(t,g,r),r},o=function(t){return s(t,g)?t[g]:{}},i=function(t){return s(t,g)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(r){var n;if(!a(r)||(n=o(r)).type!==t)throw d("Incompatible receiver, "+t+" required");return n}}}},5557:function(t,r,n){var e=n(6802),o=n(501),i=e("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||u[i]===t)}},119:function(t,r,n){var e=n(5489);t.exports=Array.isArray||function(t){return"Array"==e(t)}},6291:function(t,r,n){var e=n(5178),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},1814:function(t,r,n){var e=n(936),o=n(5061),i=n(6291),u=n(486),c=n(3425),a=n(685),f=function(){},s=[],p=c("Reflect","construct"),v=/^\s*(?:class|function)\b/,l=e(v.exec),y=!v.exec(f),d=function(t){if(!i(t))return!1;try{return p(f,s,t),!0}catch(t){return!1}},h=function(t){if(!i(t))return!1;switch(u(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return y||!!l(v,a(t))}catch(t){return!0}};h.sham=!0,t.exports=!p||o((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?h:d},1092:function(t,r,n){var e=n(5061),o=n(6291),i=/#|\.prototype\./,u=function(t,r){var n=a[c(t)];return n==s||n!=f&&(o(r)?e(r):!!r)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},860:function(t){t.exports=function(t){return null==t}},2366:function(t,r,n){var e=n(6291),o=n(5178),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},13:function(t){t.exports=!1},6448:function(t,r,n){var e=n(3425),o=n(6291),i=n(6282),u=n(7558),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=e("Symbol");return o(r)&&i(r.prototype,c(t))}},8971:function(t,r,n){var e=n(9918),o=n(3927),i=n(4905),u=n(7073),c=n(5557),a=n(4821),f=n(6282),s=n(8437),p=n(6354),v=n(9200),l=TypeError,y=function(t,r){this.stopped=t,this.result=r},d=y.prototype;t.exports=function(t,r,n){var h,b,g,m,x,O,j,w=n&&n.that,S=!(!n||!n.AS_ENTRIES),P=!(!n||!n.IS_RECORD),E=!(!n||!n.IS_ITERATOR),T=!(!n||!n.INTERRUPTED),A=e(r,w),R=function(t){return h&&v(h,"normal",t),new y(!0,t)},C=function(t){return S?(i(t),T?A(t[0],t[1],R):A(t[0],t[1])):T?A(t,R):A(t)};if(P)h=t.iterator;else if(E)h=t;else{if(!(b=p(t)))throw l(u(t)+" is not iterable");if(c(b)){for(g=0,m=a(t);m>g;g++)if((x=C(t[g]))&&f(d,x))return x;return new y(!1)}h=s(t,b)}for(O=P?t.next:h.next;!(j=o(O,h)).done;){try{x=C(j.value)}catch(t){v(h,"throw",t)}if("object"==typeof x&&x&&f(d,x))return x}return new y(!1)}},9200:function(t,r,n){var e=n(3927),o=n(4905),i=n(3815);t.exports=function(t,r,n){var u,c;o(t);try{if(!(u=i(t,"return"))){if("throw"===r)throw n;return n}u=e(u,t)}catch(t){c=!0,u=t}if("throw"===r)throw n;if(c)throw u;return o(u),n}},501:function(t){t.exports={}},4821:function(t,r,n){var e=n(4479);t.exports=function(t){return e(t.length)}},7192:function(t,r,n){var e=n(5061),o=n(6291),i=n(8382),u=n(1502),c=n(9873).CONFIGURABLE,a=n(685),f=n(684),s=f.enforce,p=f.get,v=Object.defineProperty,l=u&&!e((function(){return 8!==v((function(){}),"length",{value:8}).length})),y=String(String).split("String"),d=t.exports=function(t,r,n){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(r="get "+r),n&&n.setter&&(r="set "+r),(!i(t,"name")||c&&t.name!==r)&&(u?v(t,"name",{value:r,configurable:!0}):t.name=r),l&&n&&i(n,"arity")&&t.length!==n.arity&&v(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?u&&v(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=s(t);return i(e,"source")||(e.source=y.join("string"==typeof r?r:"")),t};Function.prototype.toString=d((function(){return o(this)&&p(this).source||a(this)}),"toString")},1367:function(t){var r=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}},3690:function(t,r,n){var e,o,i,u,c,a,f,s,p=n(5001),v=n(9918),l=n(8117).f,y=n(8680).set,d=n(311),h=n(1368),b=n(4832),g=n(566),m=p.MutationObserver||p.WebKitMutationObserver,x=p.document,O=p.process,j=p.Promise,w=l(p,"queueMicrotask"),S=w&&w.value;S||(e=function(){var t,r;for(g&&(t=O.domain)&&t.exit();o;){r=o.fn,o=o.next;try{r()}catch(t){throw o?u():i=void 0,t}}i=void 0,t&&t.enter()},d||g||b||!m||!x?!h&&j&&j.resolve?((f=j.resolve(void 0)).constructor=j,s=v(f.then,f),u=function(){s(e)}):g?u=function(){O.nextTick(e)}:(y=v(y,p),u=function(){y(e)}):(c=!0,a=x.createTextNode(""),new m(e).observe(a,{characterData:!0}),u=function(){a.data=c=!c})),t.exports=S||function(t){var r={fn:t,next:void 0};i&&(i.next=r),o||(o=r,u()),i=r}},7714:function(t,r,n){"use strict";var e=n(4933),o=TypeError,i=function(t){var r,n;this.promise=new t((function(t,e){if(void 0!==r||void 0!==n)throw o("Bad Promise constructor");r=t,n=e})),this.resolve=e(r),this.reject=e(n)};t.exports.f=function(t){return new i(t)}},6462:function(t,r,n){var e=n(1502),o=n(7788),i=n(5780),u=n(4905),c=n(1030),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",v="configurable",l="writable";r.f=e?i?function(t,r,n){if(u(t),r=c(r),u(n),"function"==typeof t&&"prototype"===r&&"value"in n&&l in n&&!n.writable){var e=s(t,r);e&&e.writable&&(t[r]=n.value,n={configurable:v in n?n.configurable:e.configurable,enumerable:p in n?n.enumerable:e.enumerable,writable:!1})}return f(t,r,n)}:f:function(t,r,n){if(u(t),r=c(r),u(n),o)try{return f(t,r,n)}catch(t){}if("get"in n||"set"in n)throw a("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},8117:function(t,r,n){var e=n(1502),o=n(3927),i=n(9265),u=n(6034),c=n(678),a=n(1030),f=n(8382),s=n(7788),p=Object.getOwnPropertyDescriptor;r.f=e?p:function(t,r){if(t=c(t),r=a(r),s)try{return p(t,r)}catch(t){}if(f(t,r))return u(!o(i.f,t,r),t[r])}},9219:function(t,r,n){var e=n(3855),o=n(2089).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},2822:function(t,r){r.f=Object.getOwnPropertySymbols},6282:function(t,r,n){var e=n(936);t.exports=e({}.isPrototypeOf)},3855:function(t,r,n){var e=n(936),o=n(8382),i=n(678),u=n(5029).indexOf,c=n(2499),a=e([].push);t.exports=function(t,r){var n,e=i(t),f=0,s=[];for(n in e)!o(c,n)&&o(e,n)&&a(s,n);for(;r.length>f;)o(e,n=r[f++])&&(~u(s,n)||a(s,n));return s}},9265:function(t,r){"use strict";var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!n.call({1:2},1);r.f=o?function(t){var r=e(this,t);return!!r&&r.enumerable}:n},2848:function(t,r,n){var e=n(936),o=n(4905),i=n(9076);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,n={};try{(t=e(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),r=n instanceof Array}catch(t){}return function(n,e){return o(n),i(e),r?t(n,e):n.__proto__=e,n}}():void 0)},379:function(t,r,n){var e=n(3927),o=n(6291),i=n(2366),u=TypeError;t.exports=function(t,r){var n,c;if("string"===r&&o(n=t.toString)&&!i(c=e(n,t)))return c;if(o(n=t.valueOf)&&!i(c=e(n,t)))return c;if("string"!==r&&o(n=t.toString)&&!i(c=e(n,t)))return c;throw u("Can't convert object to primitive value")}},2466:function(t,r,n){var e=n(3425),o=n(936),i=n(9219),u=n(2822),c=n(4905),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var r=i.f(c(t)),n=u.f;return n?a(r,n(t)):r}},7040:function(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},8410:function(t,r,n){var e=n(5001),o=n(7883),i=n(6291),u=n(1092),c=n(685),a=n(6802),f=n(6837),s=n(5065),p=n(13),v=n(2821),l=o&&o.prototype,y=a("species"),d=!1,h=i(e.PromiseRejectionEvent),b=u("Promise",(function(){var t=c(o),r=t!==String(o);if(!r&&66===v)return!0;if(p&&(!l.catch||!l.finally))return!0;if(!v||v<51||!/native code/.test(t)){var n=new o((function(t){t(1)})),e=function(t){t((function(){}),(function(){}))};if((n.constructor={})[y]=e,!(d=n.then((function(){}))instanceof e))return!0}return!r&&(f||s)&&!h}));t.exports={CONSTRUCTOR:b,REJECTION_EVENT:h,SUBCLASSING:d}},7883:function(t,r,n){var e=n(5001);t.exports=e.Promise},7504:function(t,r,n){var e=n(4905),o=n(2366),i=n(7714);t.exports=function(t,r){if(e(t),o(r)&&r.constructor===t)return r;var n=i.f(t);return(0,n.resolve)(r),n.promise}},3653:function(t,r,n){var e=n(7883),o=n(3165),i=n(8410).CONSTRUCTOR;t.exports=i||!o((function(t){e.all(t).then(void 0,(function(){}))}))},8791:function(t){var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=r},4475:function(t,r,n){var e=n(860),o=TypeError;t.exports=function(t){if(e(t))throw o("Can't call method on "+t);return t}},3126:function(t,r,n){"use strict";var e=n(3425),o=n(6462),i=n(6802),u=n(1502),c=i("species");t.exports=function(t){var r=e(t),n=o.f;u&&r&&!r[c]&&n(r,c,{configurable:!0,get:function(){return this}})}},606:function(t,r,n){var e=n(6462).f,o=n(8382),i=n(6802)("toStringTag");t.exports=function(t,r,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:r})}},1695:function(t,r,n){var e=n(6809),o=n(1050),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},9982:function(t,r,n){var e=n(5001),o=n(1756),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},6809:function(t,r,n){var e=n(13),o=n(9982);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.26.1",mode:e?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})},3571:function(t,r,n){var e=n(4905),o=n(8209),i=n(860),u=n(6802)("species");t.exports=function(t,r){var n,c=e(t).constructor;return void 0===c||i(n=e(c)[u])?r:o(n)}},5947:function(t,r,n){var e=n(2821),o=n(5061);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},8680:function(t,r,n){var e,o,i,u,c=n(5001),a=n(5494),f=n(9918),s=n(6291),p=n(8382),v=n(5061),l=n(2118),y=n(650),d=n(6009),h=n(7427),b=n(311),g=n(566),m=c.setImmediate,x=c.clearImmediate,O=c.process,j=c.Dispatch,w=c.Function,S=c.MessageChannel,P=c.String,E=0,T={},A="onreadystatechange";try{e=c.location}catch(t){}var R=function(t){if(p(T,t)){var r=T[t];delete T[t],r()}},C=function(t){return function(){R(t)}},D=function(t){R(t.data)},I=function(t){c.postMessage(P(t),e.protocol+"//"+e.host)};m&&x||(m=function(t){h(arguments.length,1);var r=s(t)?t:w(t),n=y(arguments,1);return T[++E]=function(){a(r,void 0,n)},o(E),E},x=function(t){delete T[t]},g?o=function(t){O.nextTick(C(t))}:j&&j.now?o=function(t){j.now(C(t))}:S&&!b?(u=(i=new S).port2,i.port1.onmessage=D,o=f(u.postMessage,u)):c.addEventListener&&s(c.postMessage)&&!c.importScripts&&e&&"file:"!==e.protocol&&!v(I)?(o=I,c.addEventListener("message",D,!1)):o=A in d("script")?function(t){l.appendChild(d("script")).onreadystatechange=function(){l.removeChild(this),R(t)}}:function(t){setTimeout(C(t),0)}),t.exports={set:m,clear:x}},6971:function(t,r,n){var e=n(9398),o=Math.max,i=Math.min;t.exports=function(t,r){var n=e(t);return n<0?o(n+r,0):i(n,r)}},678:function(t,r,n){var e=n(2901),o=n(4475);t.exports=function(t){return e(o(t))}},9398:function(t,r,n){var e=n(1367);t.exports=function(t){var r=+t;return r!=r||0===r?0:e(r)}},4479:function(t,r,n){var e=n(9398),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},7615:function(t,r,n){var e=n(4475),o=Object;t.exports=function(t){return o(e(t))}},6973:function(t,r,n){var e=n(3927),o=n(2366),i=n(6448),u=n(3815),c=n(379),a=n(6802),f=TypeError,s=a("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var n,a=u(t,s);if(a){if(void 0===r&&(r="default"),n=e(a,t,r),!o(n)||i(n))return n;throw f("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},1030:function(t,r,n){var e=n(6973),o=n(6448);t.exports=function(t){var r=e(t,"string");return o(r)?r:r+""}},8171:function(t,r,n){var e={};e[n(6802)("toStringTag")]="z",t.exports="[object z]"===String(e)},7073:function(t){var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},1050:function(t,r,n){var e=n(936),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},7558:function(t,r,n){var e=n(5947);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5780:function(t,r,n){var e=n(1502),o=n(5061);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},7427:function(t){var r=TypeError;t.exports=function(t,n){if(t<n)throw r("Not enough arguments");return t}},1899:function(t,r,n){var e=n(5001),o=n(6291),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},6802:function(t,r,n){var e=n(5001),o=n(6809),i=n(8382),u=n(1050),c=n(5947),a=n(7558),f=o("wks"),s=e.Symbol,p=s&&s.for,v=a?s:s&&s.withoutSetter||u;t.exports=function(t){if(!i(f,t)||!c&&"string"!=typeof f[t]){var r="Symbol."+t;c&&i(s,t)?f[t]=s[t]:f[t]=a&&p?p(r):v(r)}return f[t]}},2937:function(t,r,n){"use strict";var e=n(9638),o=n(2040).left,i=n(9020),u=n(2821),c=n(566);e({target:"Array",proto:!0,forced:!i("reduce")||!c&&u>79&&u<83},{reduce:function(t){var r=arguments.length;return o(this,t,r,r>1?arguments[1]:void 0)}})},8547:function(t,r,n){"use strict";var e=n(9638),o=n(936),i=n(119),u=o([].reverse),c=[1,2];e({target:"Array",proto:!0,forced:String(c)===String(c.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),u(this)}})},5370:function(t,r,n){"use strict";var e=n(9638),o=n(3927),i=n(4933),u=n(7714),c=n(7040),a=n(8971);e({target:"Promise",stat:!0,forced:n(3653)},{all:function(t){var r=this,n=u.f(r),e=n.resolve,f=n.reject,s=c((function(){var n=i(r.resolve),u=[],c=0,s=1;a(t,(function(t){var i=c++,a=!1;s++,o(n,r,t).then((function(t){a||(a=!0,u[i]=t,--s||e(u))}),f)})),--s||e(u)}));return s.error&&f(s.value),n.promise}})},4139:function(t,r,n){"use strict";var e=n(9638),o=n(13),i=n(8410).CONSTRUCTOR,u=n(7883),c=n(3425),a=n(6291),f=n(5850),s=u&&u.prototype;if(e({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&a(u)){var p=c("Promise").prototype.catch;s.catch!==p&&f(s,"catch",p,{unsafe:!0})}},9688:function(t,r,n){"use strict";var e,o,i,u=n(9638),c=n(13),a=n(566),f=n(5001),s=n(3927),p=n(5850),v=n(2848),l=n(606),y=n(3126),d=n(4933),h=n(6291),b=n(2366),g=n(2814),m=n(3571),x=n(8680).set,O=n(3690),j=n(3455),w=n(7040),S=n(8791),P=n(684),E=n(7883),T=n(8410),A=n(7714),R="Promise",C=T.CONSTRUCTOR,D=T.REJECTION_EVENT,I=T.SUBCLASSING,M=P.getterFor(R),_=P.set,F=E&&E.prototype,N=E,k=F,L=f.TypeError,U=f.document,K=f.process,z=A.f,G=z,q=!!(U&&U.createEvent&&f.dispatchEvent),B="unhandledrejection",H=function(t){var r;return!(!b(t)||!h(r=t.then))&&r},W=function(t,r){var n,e,o,i=r.value,u=1==r.state,c=u?t.ok:t.fail,a=t.resolve,f=t.reject,p=t.domain;try{c?(u||(2===r.rejection&&X(r),r.rejection=1),!0===c?n=i:(p&&p.enter(),n=c(i),p&&(p.exit(),o=!0)),n===t.promise?f(L("Promise-chain cycle")):(e=H(n))?s(e,n,a,f):a(n)):f(i)}catch(t){p&&!o&&p.exit(),f(t)}},V=function(t,r){t.notified||(t.notified=!0,O((function(){for(var n,e=t.reactions;n=e.get();)W(n,t);t.notified=!1,r&&!t.rejection&&$(t)})))},J=function(t,r,n){var e,o;q?((e=U.createEvent("Event")).promise=r,e.reason=n,e.initEvent(t,!1,!0),f.dispatchEvent(e)):e={promise:r,reason:n},!D&&(o=f["on"+t])?o(e):t===B&&j("Unhandled promise rejection",n)},$=function(t){s(x,f,(function(){var r,n=t.facade,e=t.value;if(Q(t)&&(r=w((function(){a?K.emit("unhandledRejection",e,n):J(B,n,e)})),t.rejection=a||Q(t)?2:1,r.error))throw r.value}))},Q=function(t){return 1!==t.rejection&&!t.parent},X=function(t){s(x,f,(function(){var r=t.facade;a?K.emit("rejectionHandled",r):J("rejectionhandled",r,t.value)}))},Y=function(t,r,n){return function(e){t(r,e,n)}},Z=function(t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,V(t,!0))},tt=function(t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===r)throw L("Promise can't be resolved itself");var e=H(r);e?O((function(){var n={done:!1};try{s(e,r,Y(tt,n,t),Y(Z,n,t))}catch(r){Z(n,r,t)}})):(t.value=r,t.state=1,V(t,!1))}catch(r){Z({done:!1},r,t)}}};if(C&&(k=(N=function(t){g(this,k),d(t),s(e,this);var r=M(this);try{t(Y(tt,r),Y(Z,r))}catch(t){Z(r,t)}}).prototype,(e=function(t){_(this,{type:R,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:void 0})}).prototype=p(k,"then",(function(t,r){var n=M(this),e=z(m(this,N));return n.parent=!0,e.ok=!h(t)||t,e.fail=h(r)&&r,e.domain=a?K.domain:void 0,0==n.state?n.reactions.add(e):O((function(){W(e,n)})),e.promise})),o=function(){var t=new e,r=M(t);this.promise=t,this.resolve=Y(tt,r),this.reject=Y(Z,r)},A.f=z=function(t){return t===N||undefined===t?new o(t):G(t)},!c&&h(E)&&F!==Object.prototype)){i=F.then,I||p(F,"then",(function(t,r){var n=this;return new N((function(t,r){s(i,n,t,r)})).then(t,r)}),{unsafe:!0});try{delete F.constructor}catch(t){}v&&v(F,k)}u({global:!0,constructor:!0,wrap:!0,forced:C},{Promise:N}),l(N,R,!1,!0),y(R)},3045:function(t,r,n){n(9688),n(5370),n(4139),n(7508),n(5858),n(1856)},7508:function(t,r,n){"use strict";var e=n(9638),o=n(3927),i=n(4933),u=n(7714),c=n(7040),a=n(8971);e({target:"Promise",stat:!0,forced:n(3653)},{race:function(t){var r=this,n=u.f(r),e=n.reject,f=c((function(){var u=i(r.resolve);a(t,(function(t){o(u,r,t).then(n.resolve,e)}))}));return f.error&&e(f.value),n.promise}})},5858:function(t,r,n){"use strict";var e=n(9638),o=n(3927),i=n(7714);e({target:"Promise",stat:!0,forced:n(8410).CONSTRUCTOR},{reject:function(t){var r=i.f(this);return o(r.reject,void 0,t),r.promise}})},1856:function(t,r,n){"use strict";var e=n(9638),o=n(3425),i=n(13),u=n(7883),c=n(8410).CONSTRUCTOR,a=n(7504),f=o("Promise"),s=i&&!c;e({target:"Promise",stat:!0,forced:i||c},{resolve:function(t){return a(s&&this===f?u:this,t)}})},7400:function(t){"use strict";t.exports=r},8156:function(r){"use strict";r.exports=t}},e={};function o(t){var r=e[t];if(void 0!==r)return r.exports;var i=e[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,r){for(var n in r)o.o(r,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){"use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function r(r,n){if(r){if("string"==typeof r)return t(r,n);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?t(r,n):void 0}}function n(n){return function(r){if(Array.isArray(r))return t(r)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||r(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function u(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var e,o,i=[],u=!0,c=!1;try{for(n=n.call(t);!(u=(e=n.next()).done)&&(i.push(e.value),!r||i.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,n)||r(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}o.r(i),o.d(i,{EffectProvider:function(){return E},Strategy:function(){return b},asyncEffect:function(){return y},useAsyncEffect:function(){return P},useMutation:function(){return S},useQuery:function(){return w},withEffectProvider:function(){return T}});o(2937),o(8547),o(3045);var c=o(8156),a=o(7400);function f(t,r){if(null==t)return{};var n,e,o=function(t,r){if(null==t)return{};var n,e,o={},i=Object.keys(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||(o[n]=t[n]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var s=["version"];function p(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function v(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?p(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}function l(t){var r=t.version,n=f(t,s),e=function(t){return v(v({},t),{},{version:r})};return{state:n,version:r||0,setState:function(r){return e("function"!=typeof r?r:r(t))},trigger:function(){return v(v({},t),{},{version:(r||0)+1})}}}function y(t){var r=(0,a.factory)(l,{data:void 0,isError:!1,isFetching:!1,abandon:!1});return r.effect=[function(){return t.apply(void 0,arguments)}],r}function d(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function h(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?d(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var b={debounce:function(t){var r=t.time;return function(t){var n=t.current,e=t.runner,o=t.store;if(o.current){var i=o.current,u=i.id,c=i.resolve;o.current=void 0,clearTimeout(u),c(h(h({},n()),{},{abandon:!0}))}return new Promise((function(t){var n=setTimeout((function(){t(e())}),r);o.current={id:n,resolve:t}}))}},once:function(){return function(t){var r=t.current,n=t.runner,e=t.store;return e.current?new Promise((function(t){t(h(h({},r()),{},{abandon:!0}))})):(e.current=!0,n().then((function(t){return t.isError&&(e.current=!1),t})))}}};function g(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function m(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?g(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}function x(t,r){if(!("function"==typeof t.pipe))return[l,t,r];var n=u(t.effect,2);return[t,n[0],n[1]||r]}function O(t){return function(r){var n=t();if(!n||"function"!=typeof n.then)throw new Error("The callback have to return a promise object.");return r(m(m({},{data:void 0,isError:!1,isFetching:!1,abandon:!1}),{},{isFetching:!0})),n.then((function(t){return r({data:t,isError:!1,isFetching:!1,abandon:!1})}),(function(t){return r({data:void 0,error:t,isError:!0,isFetching:!1,abandon:!1})}))}}function j(t,r){return n(r).reverse().reduce((function(r,n,e){var o=t[e]||{current:void 0};return function(t){if(null==n)return r(t);return n(m(m({},t),{},{store:o,runner:function(){return r(t)}}))}}),(function(t){return t.runner()}))}function w(t,r){var e=u(x(t,Array.isArray(r)?{variables:r}:r),3),o=e[0],i=e[1],f=e[2],s=o===l?[o,{data:void 0,isError:!1,isFetching:!1,abandon:!1}]:[o],p=a.useModel.apply(void 0,n(s)),v=f||{},y=v.variables,d=v.deps,h=v.manual,b=v.strategy,g=!d&&!y||h,w=Array.isArray(b)?b:[b],S=O((function(){return i.apply(void 0,n(y||[]))})),P=(0,c.useRef)({}),E=(0,c.useRef)(w.map((function(){return{current:void 0}}))),T=(0,c.useRef)(0),A=function(){var t=T.current+1;T.current=t;return S((function(r){var n=p.state,e=p.setState,o=t!==T.current,i=function(t){return o||e(t),t};return r.isFetching?i(m(m({},r),{},{data:n.data,abandon:o,fetchingKey:P.current})):r.isError?i(m(m(m({},n),r),{},{data:n.data,abandon:o,fetchingKey:void 0})):i(m(m({},r),{},{abandon:o,fetchingKey:void 0}))}))},R=function(t){if(!b)return t();var r={current:function(){return p.state},variables:y,runner:t,store:E};return j(E.current,w)(r)},C=function(){return R(A)};(0,c.useLayoutEffect)((function(){if(!g){var t=p.state.fetchingKey;t&&t!==P.current||function(){var t=p.state.fetchingKey;t&&t!==P.current||R(A)}()}}),d||y||[]);var D=(0,c.useRef)(p.version);return(0,c.useEffect)((function(){D.current!==p.version&&(D.current=p.version,C())}),[p.version]),[p.state,C]}function S(t,r){var e=u(x(t,Array.isArray(r)?{variables:r}:r),3),o=e[0],i=e[1],f=e[2],s=o===l?[o,{data:void 0,isError:!1,isFetching:!1,abandon:!1}]:[o],p=a.useModel.apply(void 0,n(s)),v=f||{},y=v.variables,d=v.strategy,h=Array.isArray(d)?d:[d],b=O((function(){return i.apply(void 0,n(y||[]))})),g=(0,c.useRef)(h.map((function(){return{current:void 0}}))),w=(0,c.useRef)({}),S=(0,c.useRef)(!1),P=function(){if(S.current)return new Promise((function(t){t(p.state)}));S.current=!0;return b((function(t){var r=p.state,n=p.setState;return t.isFetching?n(m(m({},t),{},{data:r.data,fetchingKey:w.current})):(S.current=!1,t.isError?n(m(m(m({},r),t),{},{data:r.data,fetchingKey:void 0})):n(m(m({},t),{},{fetchingKey:void 0})))}))},E=function(){return function(t){if(!d)return t();var r={current:function(){return p.state},variables:y,runner:t,store:g};return j(g.current,h)(r)}(P)},T=(0,c.useRef)(p.version);return(0,c.useEffect)((function(){T.current!==p.version&&(T.current=p.version,E())}),[p.version]),[p.state,E]}function P(t){return(0,a.useSelector)(t,(function(t){return[t.state,t.trigger]}))}var E=a.ModelProvider,T=a.withModelProvider}(),i}()}));
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@airma/react-state")):"function"==typeof define&&define.amd?define(["react","@airma/react-state"],r):"object"==typeof exports?exports["@airma/react-effect"]=r(require("react"),require("@airma/react-state")):t["@airma/react-effect"]=r(t.react,t["@airma/react-state"])}(self,(function(t,r){return function(){var n={4933:function(t,r,n){var e=n(6291),o=n(7073),i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not a function")}},8209:function(t,r,n){var e=n(1814),o=n(7073),i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not a constructor")}},9076:function(t,r,n){var e=n(6291),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||e(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},2814:function(t,r,n){var e=n(6282),o=TypeError;t.exports=function(t,r){if(e(r,t))return t;throw o("Incorrect invocation")}},4905:function(t,r,n){var e=n(2366),o=String,i=TypeError;t.exports=function(t){if(e(t))return t;throw i(o(t)+" is not an object")}},5029:function(t,r,n){var e=n(678),o=n(6971),i=n(4821),u=function(t){return function(r,n,u){var c,a=e(r),f=i(a),s=o(u,f);if(t&&n!=n){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},9020:function(t,r,n){"use strict";var e=n(5061);t.exports=function(t,r){var n=[][t];return!!n&&e((function(){n.call(null,r||function(){return 1},1)}))}},2040:function(t,r,n){var e=n(4933),o=n(7615),i=n(2901),u=n(4821),c=TypeError,a=function(t){return function(r,n,a,f){e(n);var s=o(r),p=i(s),v=u(s),l=t?v-1:0,y=t?-1:1;if(a<2)for(;;){if(l in p){f=p[l],l+=y;break}if(l+=y,t?l<0:v<=l)throw c("Reduce of empty array with no initial value")}for(;t?l>=0:v>l;l+=y)l in p&&(f=n(f,p[l],l,s));return f}};t.exports={left:a(!1),right:a(!0)}},650:function(t,r,n){var e=n(936);t.exports=e([].slice)},3165:function(t,r,n){var e=n(6802)("iterator"),o=!1;try{var i=0,u={next:function(){return{done:!!i++}},return:function(){o=!0}};u[e]=function(){return this},Array.from(u,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!o)return!1;var n=!1;try{var i={};i[e]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},5489:function(t,r,n){var e=n(936),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},486:function(t,r,n){var e=n(8171),o=n(6291),i=n(5489),u=n(6802)("toStringTag"),c=Object,a="Arguments"==i(function(){return arguments}());t.exports=e?i:function(t){var r,n,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,r){try{return t[r]}catch(t){}}(r=c(t),u))?n:a?i(r):"Object"==(e=i(r))&&o(r.callee)?"Arguments":e}},6810:function(t,r,n){var e=n(8382),o=n(2466),i=n(8117),u=n(6462);t.exports=function(t,r,n){for(var c=o(r),a=u.f,f=i.f,s=0;s<c.length;s++){var p=c[s];e(t,p)||n&&e(n,p)||a(t,p,f(r,p))}}},430:function(t,r,n){var e=n(1502),o=n(6462),i=n(6034);t.exports=e?function(t,r,n){return o.f(t,r,i(1,n))}:function(t,r,n){return t[r]=n,t}},6034:function(t){t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},5850:function(t,r,n){var e=n(6291),o=n(6462),i=n(7192),u=n(1756);t.exports=function(t,r,n,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:r;if(e(n)&&i(n,f,c),c.global)a?t[r]=n:u(r,n);else{try{c.unsafe?t[r]&&(a=!0):delete t[r]}catch(t){}a?t[r]=n:o.f(t,r,{value:n,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},1756:function(t,r,n){var e=n(5001),o=Object.defineProperty;t.exports=function(t,r){try{o(e,t,{value:r,configurable:!0,writable:!0})}catch(n){e[t]=r}return r}},1502:function(t,r,n){var e=n(5061);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},5178:function(t){var r="object"==typeof document&&document.all,n=void 0===r&&void 0!==r;t.exports={all:r,IS_HTMLDDA:n}},6009:function(t,r,n){var e=n(5001),o=n(2366),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},6837:function(t,r,n){var e=n(5065),o=n(566);t.exports=!e&&!o&&"object"==typeof window&&"object"==typeof document},5065:function(t){t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},1368:function(t,r,n){var e=n(9966),o=n(5001);t.exports=/ipad|iphone|ipod/i.test(e)&&void 0!==o.Pebble},311:function(t,r,n){var e=n(9966);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(e)},566:function(t,r,n){var e=n(5489),o=n(5001);t.exports="process"==e(o.process)},4832:function(t,r,n){var e=n(9966);t.exports=/web0s(?!.*chrome)/i.test(e)},9966:function(t,r,n){var e=n(3425);t.exports=e("navigator","userAgent")||""},2821:function(t,r,n){var e,o,i=n(5001),u=n(9966),c=i.process,a=i.Deno,f=c&&c.versions||a&&a.version,s=f&&f.v8;s&&(o=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},2089:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9638:function(t,r,n){var e=n(5001),o=n(8117).f,i=n(430),u=n(5850),c=n(1756),a=n(6810),f=n(1092);t.exports=function(t,r){var n,s,p,v,l,y=t.target,h=t.global,d=t.stat;if(n=h?e:d?e[y]||c(y,{}):(e[y]||{}).prototype)for(s in r){if(v=r[s],p=t.dontCallGetSet?(l=o(n,s))&&l.value:n[s],!f(h?s:y+(d?".":"#")+s,t.forced)&&void 0!==p){if(typeof v==typeof p)continue;a(v,p)}(t.sham||p&&p.sham)&&i(v,"sham",!0),u(n,s,v,t)}}},5061:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},5494:function(t,r,n){var e=n(8483),o=Function.prototype,i=o.apply,u=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(e?u.bind(i):function(){return u.apply(i,arguments)})},9918:function(t,r,n){var e=n(1017),o=n(4933),i=n(8483),u=e(e.bind);t.exports=function(t,r){return o(t),void 0===r?t:i?u(t,r):function(){return t.apply(r,arguments)}}},8483:function(t,r,n){var e=n(5061);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},3927:function(t,r,n){var e=n(8483),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},9873:function(t,r,n){var e=n(1502),o=n(8382),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},1017:function(t,r,n){var e=n(5489),o=n(936);t.exports=function(t){if("Function"===e(t))return o(t)}},936:function(t,r,n){var e=n(8483),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},3425:function(t,r,n){var e=n(5001),o=n(6291),i=function(t){return o(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?i(e[t]):e[t]&&e[t][r]}},6354:function(t,r,n){var e=n(486),o=n(3815),i=n(860),u=n(501),c=n(6802)("iterator");t.exports=function(t){if(!i(t))return o(t,c)||o(t,"@@iterator")||u[e(t)]}},8437:function(t,r,n){var e=n(3927),o=n(4933),i=n(4905),u=n(7073),c=n(6354),a=TypeError;t.exports=function(t,r){var n=arguments.length<2?c(t):r;if(o(n))return i(e(n,t));throw a(u(t)+" is not iterable")}},3815:function(t,r,n){var e=n(4933),o=n(860);t.exports=function(t,r){var n=t[r];return o(n)?void 0:e(n)}},5001:function(t,r,n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},8382:function(t,r,n){var e=n(936),o=n(7615),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},2499:function(t){t.exports={}},3455:function(t,r,n){var e=n(5001);t.exports=function(t,r){var n=e.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,r))}},2118:function(t,r,n){var e=n(3425);t.exports=e("document","documentElement")},7788:function(t,r,n){var e=n(1502),o=n(5061),i=n(6009);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},2901:function(t,r,n){var e=n(936),o=n(5061),i=n(5489),u=Object,c=e("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):u(t)}:u},685:function(t,r,n){var e=n(936),o=n(6291),i=n(9982),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},684:function(t,r,n){var e,o,i,u=n(1899),c=n(5001),a=n(2366),f=n(430),s=n(8382),p=n(9982),v=n(1695),l=n(2499),y="Object already initialized",h=c.TypeError,d=c.WeakMap;if(u||p.state){var b=p.state||(p.state=new d);b.get=b.get,b.has=b.has,b.set=b.set,e=function(t,r){if(b.has(t))throw h(y);return r.facade=t,b.set(t,r),r},o=function(t){return b.get(t)||{}},i=function(t){return b.has(t)}}else{var g=v("state");l[g]=!0,e=function(t,r){if(s(t,g))throw h(y);return r.facade=t,f(t,g,r),r},o=function(t){return s(t,g)?t[g]:{}},i=function(t){return s(t,g)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(r){var n;if(!a(r)||(n=o(r)).type!==t)throw h("Incompatible receiver, "+t+" required");return n}}}},5557:function(t,r,n){var e=n(6802),o=n(501),i=e("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||u[i]===t)}},119:function(t,r,n){var e=n(5489);t.exports=Array.isArray||function(t){return"Array"==e(t)}},6291:function(t,r,n){var e=n(5178),o=e.all;t.exports=e.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},1814:function(t,r,n){var e=n(936),o=n(5061),i=n(6291),u=n(486),c=n(3425),a=n(685),f=function(){},s=[],p=c("Reflect","construct"),v=/^\s*(?:class|function)\b/,l=e(v.exec),y=!v.exec(f),h=function(t){if(!i(t))return!1;try{return p(f,s,t),!0}catch(t){return!1}},d=function(t){if(!i(t))return!1;switch(u(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return y||!!l(v,a(t))}catch(t){return!0}};d.sham=!0,t.exports=!p||o((function(){var t;return h(h.call)||!h(Object)||!h((function(){t=!0}))||t}))?d:h},1092:function(t,r,n){var e=n(5061),o=n(6291),i=/#|\.prototype\./,u=function(t,r){var n=a[c(t)];return n==s||n!=f&&(o(r)?e(r):!!r)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},860:function(t){t.exports=function(t){return null==t}},2366:function(t,r,n){var e=n(6291),o=n(5178),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:e(t)||t===i}:function(t){return"object"==typeof t?null!==t:e(t)}},13:function(t){t.exports=!1},6448:function(t,r,n){var e=n(3425),o=n(6291),i=n(6282),u=n(7558),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=e("Symbol");return o(r)&&i(r.prototype,c(t))}},8971:function(t,r,n){var e=n(9918),o=n(3927),i=n(4905),u=n(7073),c=n(5557),a=n(4821),f=n(6282),s=n(8437),p=n(6354),v=n(9200),l=TypeError,y=function(t,r){this.stopped=t,this.result=r},h=y.prototype;t.exports=function(t,r,n){var d,b,g,m,x,O,j,w=n&&n.that,S=!(!n||!n.AS_ENTRIES),P=!(!n||!n.IS_RECORD),E=!(!n||!n.IS_ITERATOR),T=!(!n||!n.INTERRUPTED),A=e(r,w),R=function(t){return d&&v(d,"normal",t),new y(!0,t)},C=function(t){return S?(i(t),T?A(t[0],t[1],R):A(t[0],t[1])):T?A(t,R):A(t)};if(P)d=t.iterator;else if(E)d=t;else{if(!(b=p(t)))throw l(u(t)+" is not iterable");if(c(b)){for(g=0,m=a(t);m>g;g++)if((x=C(t[g]))&&f(h,x))return x;return new y(!1)}d=s(t,b)}for(O=P?t.next:d.next;!(j=o(O,d)).done;){try{x=C(j.value)}catch(t){v(d,"throw",t)}if("object"==typeof x&&x&&f(h,x))return x}return new y(!1)}},9200:function(t,r,n){var e=n(3927),o=n(4905),i=n(3815);t.exports=function(t,r,n){var u,c;o(t);try{if(!(u=i(t,"return"))){if("throw"===r)throw n;return n}u=e(u,t)}catch(t){c=!0,u=t}if("throw"===r)throw n;if(c)throw u;return o(u),n}},501:function(t){t.exports={}},4821:function(t,r,n){var e=n(4479);t.exports=function(t){return e(t.length)}},7192:function(t,r,n){var e=n(5061),o=n(6291),i=n(8382),u=n(1502),c=n(9873).CONFIGURABLE,a=n(685),f=n(684),s=f.enforce,p=f.get,v=Object.defineProperty,l=u&&!e((function(){return 8!==v((function(){}),"length",{value:8}).length})),y=String(String).split("String"),h=t.exports=function(t,r,n){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(r="get "+r),n&&n.setter&&(r="set "+r),(!i(t,"name")||c&&t.name!==r)&&(u?v(t,"name",{value:r,configurable:!0}):t.name=r),l&&n&&i(n,"arity")&&t.length!==n.arity&&v(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?u&&v(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=s(t);return i(e,"source")||(e.source=y.join("string"==typeof r?r:"")),t};Function.prototype.toString=h((function(){return o(this)&&p(this).source||a(this)}),"toString")},1367:function(t){var r=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}},3690:function(t,r,n){var e,o,i,u,c,a,f,s,p=n(5001),v=n(9918),l=n(8117).f,y=n(8680).set,h=n(311),d=n(1368),b=n(4832),g=n(566),m=p.MutationObserver||p.WebKitMutationObserver,x=p.document,O=p.process,j=p.Promise,w=l(p,"queueMicrotask"),S=w&&w.value;S||(e=function(){var t,r;for(g&&(t=O.domain)&&t.exit();o;){r=o.fn,o=o.next;try{r()}catch(t){throw o?u():i=void 0,t}}i=void 0,t&&t.enter()},h||g||b||!m||!x?!d&&j&&j.resolve?((f=j.resolve(void 0)).constructor=j,s=v(f.then,f),u=function(){s(e)}):g?u=function(){O.nextTick(e)}:(y=v(y,p),u=function(){y(e)}):(c=!0,a=x.createTextNode(""),new m(e).observe(a,{characterData:!0}),u=function(){a.data=c=!c})),t.exports=S||function(t){var r={fn:t,next:void 0};i&&(i.next=r),o||(o=r,u()),i=r}},7714:function(t,r,n){"use strict";var e=n(4933),o=TypeError,i=function(t){var r,n;this.promise=new t((function(t,e){if(void 0!==r||void 0!==n)throw o("Bad Promise constructor");r=t,n=e})),this.resolve=e(r),this.reject=e(n)};t.exports.f=function(t){return new i(t)}},6462:function(t,r,n){var e=n(1502),o=n(7788),i=n(5780),u=n(4905),c=n(1030),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",v="configurable",l="writable";r.f=e?i?function(t,r,n){if(u(t),r=c(r),u(n),"function"==typeof t&&"prototype"===r&&"value"in n&&l in n&&!n.writable){var e=s(t,r);e&&e.writable&&(t[r]=n.value,n={configurable:v in n?n.configurable:e.configurable,enumerable:p in n?n.enumerable:e.enumerable,writable:!1})}return f(t,r,n)}:f:function(t,r,n){if(u(t),r=c(r),u(n),o)try{return f(t,r,n)}catch(t){}if("get"in n||"set"in n)throw a("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},8117:function(t,r,n){var e=n(1502),o=n(3927),i=n(9265),u=n(6034),c=n(678),a=n(1030),f=n(8382),s=n(7788),p=Object.getOwnPropertyDescriptor;r.f=e?p:function(t,r){if(t=c(t),r=a(r),s)try{return p(t,r)}catch(t){}if(f(t,r))return u(!o(i.f,t,r),t[r])}},9219:function(t,r,n){var e=n(3855),o=n(2089).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},2822:function(t,r){r.f=Object.getOwnPropertySymbols},6282:function(t,r,n){var e=n(936);t.exports=e({}.isPrototypeOf)},3855:function(t,r,n){var e=n(936),o=n(8382),i=n(678),u=n(5029).indexOf,c=n(2499),a=e([].push);t.exports=function(t,r){var n,e=i(t),f=0,s=[];for(n in e)!o(c,n)&&o(e,n)&&a(s,n);for(;r.length>f;)o(e,n=r[f++])&&(~u(s,n)||a(s,n));return s}},9265:function(t,r){"use strict";var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!n.call({1:2},1);r.f=o?function(t){var r=e(this,t);return!!r&&r.enumerable}:n},2848:function(t,r,n){var e=n(936),o=n(4905),i=n(9076);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,n={};try{(t=e(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),r=n instanceof Array}catch(t){}return function(n,e){return o(n),i(e),r?t(n,e):n.__proto__=e,n}}():void 0)},379:function(t,r,n){var e=n(3927),o=n(6291),i=n(2366),u=TypeError;t.exports=function(t,r){var n,c;if("string"===r&&o(n=t.toString)&&!i(c=e(n,t)))return c;if(o(n=t.valueOf)&&!i(c=e(n,t)))return c;if("string"!==r&&o(n=t.toString)&&!i(c=e(n,t)))return c;throw u("Can't convert object to primitive value")}},2466:function(t,r,n){var e=n(3425),o=n(936),i=n(9219),u=n(2822),c=n(4905),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var r=i.f(c(t)),n=u.f;return n?a(r,n(t)):r}},7040:function(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},8410:function(t,r,n){var e=n(5001),o=n(7883),i=n(6291),u=n(1092),c=n(685),a=n(6802),f=n(6837),s=n(5065),p=n(13),v=n(2821),l=o&&o.prototype,y=a("species"),h=!1,d=i(e.PromiseRejectionEvent),b=u("Promise",(function(){var t=c(o),r=t!==String(o);if(!r&&66===v)return!0;if(p&&(!l.catch||!l.finally))return!0;if(!v||v<51||!/native code/.test(t)){var n=new o((function(t){t(1)})),e=function(t){t((function(){}),(function(){}))};if((n.constructor={})[y]=e,!(h=n.then((function(){}))instanceof e))return!0}return!r&&(f||s)&&!d}));t.exports={CONSTRUCTOR:b,REJECTION_EVENT:d,SUBCLASSING:h}},7883:function(t,r,n){var e=n(5001);t.exports=e.Promise},7504:function(t,r,n){var e=n(4905),o=n(2366),i=n(7714);t.exports=function(t,r){if(e(t),o(r)&&r.constructor===t)return r;var n=i.f(t);return(0,n.resolve)(r),n.promise}},3653:function(t,r,n){var e=n(7883),o=n(3165),i=n(8410).CONSTRUCTOR;t.exports=i||!o((function(t){e.all(t).then(void 0,(function(){}))}))},8791:function(t){var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=r},4475:function(t,r,n){var e=n(860),o=TypeError;t.exports=function(t){if(e(t))throw o("Can't call method on "+t);return t}},3126:function(t,r,n){"use strict";var e=n(3425),o=n(6462),i=n(6802),u=n(1502),c=i("species");t.exports=function(t){var r=e(t),n=o.f;u&&r&&!r[c]&&n(r,c,{configurable:!0,get:function(){return this}})}},606:function(t,r,n){var e=n(6462).f,o=n(8382),i=n(6802)("toStringTag");t.exports=function(t,r,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:r})}},1695:function(t,r,n){var e=n(6809),o=n(1050),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},9982:function(t,r,n){var e=n(5001),o=n(1756),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},6809:function(t,r,n){var e=n(13),o=n(9982);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.26.1",mode:e?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})},3571:function(t,r,n){var e=n(4905),o=n(8209),i=n(860),u=n(6802)("species");t.exports=function(t,r){var n,c=e(t).constructor;return void 0===c||i(n=e(c)[u])?r:o(n)}},5947:function(t,r,n){var e=n(2821),o=n(5061);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},8680:function(t,r,n){var e,o,i,u,c=n(5001),a=n(5494),f=n(9918),s=n(6291),p=n(8382),v=n(5061),l=n(2118),y=n(650),h=n(6009),d=n(7427),b=n(311),g=n(566),m=c.setImmediate,x=c.clearImmediate,O=c.process,j=c.Dispatch,w=c.Function,S=c.MessageChannel,P=c.String,E=0,T={},A="onreadystatechange";try{e=c.location}catch(t){}var R=function(t){if(p(T,t)){var r=T[t];delete T[t],r()}},C=function(t){return function(){R(t)}},D=function(t){R(t.data)},I=function(t){c.postMessage(P(t),e.protocol+"//"+e.host)};m&&x||(m=function(t){d(arguments.length,1);var r=s(t)?t:w(t),n=y(arguments,1);return T[++E]=function(){a(r,void 0,n)},o(E),E},x=function(t){delete T[t]},g?o=function(t){O.nextTick(C(t))}:j&&j.now?o=function(t){j.now(C(t))}:S&&!b?(u=(i=new S).port2,i.port1.onmessage=D,o=f(u.postMessage,u)):c.addEventListener&&s(c.postMessage)&&!c.importScripts&&e&&"file:"!==e.protocol&&!v(I)?(o=I,c.addEventListener("message",D,!1)):o=A in h("script")?function(t){l.appendChild(h("script")).onreadystatechange=function(){l.removeChild(this),R(t)}}:function(t){setTimeout(C(t),0)}),t.exports={set:m,clear:x}},6971:function(t,r,n){var e=n(9398),o=Math.max,i=Math.min;t.exports=function(t,r){var n=e(t);return n<0?o(n+r,0):i(n,r)}},678:function(t,r,n){var e=n(2901),o=n(4475);t.exports=function(t){return e(o(t))}},9398:function(t,r,n){var e=n(1367);t.exports=function(t){var r=+t;return r!=r||0===r?0:e(r)}},4479:function(t,r,n){var e=n(9398),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},7615:function(t,r,n){var e=n(4475),o=Object;t.exports=function(t){return o(e(t))}},6973:function(t,r,n){var e=n(3927),o=n(2366),i=n(6448),u=n(3815),c=n(379),a=n(6802),f=TypeError,s=a("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var n,a=u(t,s);if(a){if(void 0===r&&(r="default"),n=e(a,t,r),!o(n)||i(n))return n;throw f("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},1030:function(t,r,n){var e=n(6973),o=n(6448);t.exports=function(t){var r=e(t,"string");return o(r)?r:r+""}},8171:function(t,r,n){var e={};e[n(6802)("toStringTag")]="z",t.exports="[object z]"===String(e)},7073:function(t){var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},1050:function(t,r,n){var e=n(936),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},7558:function(t,r,n){var e=n(5947);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5780:function(t,r,n){var e=n(1502),o=n(5061);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},7427:function(t){var r=TypeError;t.exports=function(t,n){if(t<n)throw r("Not enough arguments");return t}},1899:function(t,r,n){var e=n(5001),o=n(6291),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},6802:function(t,r,n){var e=n(5001),o=n(6809),i=n(8382),u=n(1050),c=n(5947),a=n(7558),f=o("wks"),s=e.Symbol,p=s&&s.for,v=a?s:s&&s.withoutSetter||u;t.exports=function(t){if(!i(f,t)||!c&&"string"!=typeof f[t]){var r="Symbol."+t;c&&i(s,t)?f[t]=s[t]:f[t]=a&&p?p(r):v(r)}return f[t]}},2937:function(t,r,n){"use strict";var e=n(9638),o=n(2040).left,i=n(9020),u=n(2821),c=n(566);e({target:"Array",proto:!0,forced:!i("reduce")||!c&&u>79&&u<83},{reduce:function(t){var r=arguments.length;return o(this,t,r,r>1?arguments[1]:void 0)}})},8547:function(t,r,n){"use strict";var e=n(9638),o=n(936),i=n(119),u=o([].reverse),c=[1,2];e({target:"Array",proto:!0,forced:String(c)===String(c.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),u(this)}})},5370:function(t,r,n){"use strict";var e=n(9638),o=n(3927),i=n(4933),u=n(7714),c=n(7040),a=n(8971);e({target:"Promise",stat:!0,forced:n(3653)},{all:function(t){var r=this,n=u.f(r),e=n.resolve,f=n.reject,s=c((function(){var n=i(r.resolve),u=[],c=0,s=1;a(t,(function(t){var i=c++,a=!1;s++,o(n,r,t).then((function(t){a||(a=!0,u[i]=t,--s||e(u))}),f)})),--s||e(u)}));return s.error&&f(s.value),n.promise}})},4139:function(t,r,n){"use strict";var e=n(9638),o=n(13),i=n(8410).CONSTRUCTOR,u=n(7883),c=n(3425),a=n(6291),f=n(5850),s=u&&u.prototype;if(e({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&a(u)){var p=c("Promise").prototype.catch;s.catch!==p&&f(s,"catch",p,{unsafe:!0})}},9688:function(t,r,n){"use strict";var e,o,i,u=n(9638),c=n(13),a=n(566),f=n(5001),s=n(3927),p=n(5850),v=n(2848),l=n(606),y=n(3126),h=n(4933),d=n(6291),b=n(2366),g=n(2814),m=n(3571),x=n(8680).set,O=n(3690),j=n(3455),w=n(7040),S=n(8791),P=n(684),E=n(7883),T=n(8410),A=n(7714),R="Promise",C=T.CONSTRUCTOR,D=T.REJECTION_EVENT,I=T.SUBCLASSING,M=P.getterFor(R),_=P.set,F=E&&E.prototype,N=E,k=F,L=f.TypeError,U=f.document,z=f.process,K=A.f,G=K,q=!!(U&&U.createEvent&&f.dispatchEvent),B="unhandledrejection",H=function(t){var r;return!(!b(t)||!d(r=t.then))&&r},W=function(t,r){var n,e,o,i=r.value,u=1==r.state,c=u?t.ok:t.fail,a=t.resolve,f=t.reject,p=t.domain;try{c?(u||(2===r.rejection&&X(r),r.rejection=1),!0===c?n=i:(p&&p.enter(),n=c(i),p&&(p.exit(),o=!0)),n===t.promise?f(L("Promise-chain cycle")):(e=H(n))?s(e,n,a,f):a(n)):f(i)}catch(t){p&&!o&&p.exit(),f(t)}},V=function(t,r){t.notified||(t.notified=!0,O((function(){for(var n,e=t.reactions;n=e.get();)W(n,t);t.notified=!1,r&&!t.rejection&&$(t)})))},J=function(t,r,n){var e,o;q?((e=U.createEvent("Event")).promise=r,e.reason=n,e.initEvent(t,!1,!0),f.dispatchEvent(e)):e={promise:r,reason:n},!D&&(o=f["on"+t])?o(e):t===B&&j("Unhandled promise rejection",n)},$=function(t){s(x,f,(function(){var r,n=t.facade,e=t.value;if(Q(t)&&(r=w((function(){a?z.emit("unhandledRejection",e,n):J(B,n,e)})),t.rejection=a||Q(t)?2:1,r.error))throw r.value}))},Q=function(t){return 1!==t.rejection&&!t.parent},X=function(t){s(x,f,(function(){var r=t.facade;a?z.emit("rejectionHandled",r):J("rejectionhandled",r,t.value)}))},Y=function(t,r,n){return function(e){t(r,e,n)}},Z=function(t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,V(t,!0))},tt=function(t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===r)throw L("Promise can't be resolved itself");var e=H(r);e?O((function(){var n={done:!1};try{s(e,r,Y(tt,n,t),Y(Z,n,t))}catch(r){Z(n,r,t)}})):(t.value=r,t.state=1,V(t,!1))}catch(r){Z({done:!1},r,t)}}};if(C&&(k=(N=function(t){g(this,k),h(t),s(e,this);var r=M(this);try{t(Y(tt,r),Y(Z,r))}catch(t){Z(r,t)}}).prototype,(e=function(t){_(this,{type:R,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:void 0})}).prototype=p(k,"then",(function(t,r){var n=M(this),e=K(m(this,N));return n.parent=!0,e.ok=!d(t)||t,e.fail=d(r)&&r,e.domain=a?z.domain:void 0,0==n.state?n.reactions.add(e):O((function(){W(e,n)})),e.promise})),o=function(){var t=new e,r=M(t);this.promise=t,this.resolve=Y(tt,r),this.reject=Y(Z,r)},A.f=K=function(t){return t===N||undefined===t?new o(t):G(t)},!c&&d(E)&&F!==Object.prototype)){i=F.then,I||p(F,"then",(function(t,r){var n=this;return new N((function(t,r){s(i,n,t,r)})).then(t,r)}),{unsafe:!0});try{delete F.constructor}catch(t){}v&&v(F,k)}u({global:!0,constructor:!0,wrap:!0,forced:C},{Promise:N}),l(N,R,!1,!0),y(R)},3045:function(t,r,n){n(9688),n(5370),n(4139),n(7508),n(5858),n(1856)},7508:function(t,r,n){"use strict";var e=n(9638),o=n(3927),i=n(4933),u=n(7714),c=n(7040),a=n(8971);e({target:"Promise",stat:!0,forced:n(3653)},{race:function(t){var r=this,n=u.f(r),e=n.reject,f=c((function(){var u=i(r.resolve);a(t,(function(t){o(u,r,t).then(n.resolve,e)}))}));return f.error&&e(f.value),n.promise}})},5858:function(t,r,n){"use strict";var e=n(9638),o=n(3927),i=n(7714);e({target:"Promise",stat:!0,forced:n(8410).CONSTRUCTOR},{reject:function(t){var r=i.f(this);return o(r.reject,void 0,t),r.promise}})},1856:function(t,r,n){"use strict";var e=n(9638),o=n(3425),i=n(13),u=n(7883),c=n(8410).CONSTRUCTOR,a=n(7504),f=o("Promise"),s=i&&!c;e({target:"Promise",stat:!0,forced:i||c},{resolve:function(t){return a(s&&this===f?u:this,t)}})},7400:function(t){"use strict";t.exports=r},8156:function(r){"use strict";r.exports=t}},e={};function o(t){var r=e[t];if(void 0!==r)return r.exports;var i=e[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,r){for(var n in r)o.o(r,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){"use strict";function t(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function r(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function n(t,n){if(t){if("string"==typeof t)return r(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?r(t,n):void 0}}function e(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||n(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var e,o,i=[],u=!0,c=!1;try{for(n=n.call(t);!(u=(e=n.next()).done)&&(i.push(e.value),!r||i.length!==r);u=!0);}catch(t){c=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,r)||n(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}o.r(i),o.d(i,{EffectProvider:function(){return C},PrimaryStrategyProvider:function(){return O},Strategy:function(){return b},asyncEffect:function(){return y},useAsyncEffect:function(){return R},useMutation:function(){return A},useQuery:function(){return T},withEffectProvider:function(){return D}});o(2937),o(8547),o(3045);var c=o(8156),a=o(7400);function f(t,r){if(null==t)return{};var n,e,o=function(t,r){if(null==t)return{};var n,e,o={},i=Object.keys(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||(o[n]=t[n]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(e=0;e<i.length;e++)n=i[e],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var s=["version"];function p(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function v(r){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?p(Object(e),!0).forEach((function(n){t(r,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):p(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}function l(t){var r=t.version,n=f(t,s),e=function(t){return v(v({},t),{},{version:r})};return{state:n,version:r||0,setState:function(r){return e("function"!=typeof r?r:r(t))},trigger:function(){return v(v({},t),{},{version:(r||0)+1})}}}function y(t){var r=(0,a.factory)(l,{data:void 0,isError:!1,isFetching:!1,abandon:!1});return r.effect=[function(){return t.apply(void 0,arguments)}],r}function h(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function d(r){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?h(Object(e),!0).forEach((function(n){t(r,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):h(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}var b={debounce:function(t){var r="number"==typeof t?t:t.time;return function(t){var n=t.current,e=t.runner,o=t.store;if(o.current){var i=o.current,u=i.id,c=i.resolve;o.current=void 0,clearTimeout(u),c(d(d({},n()),{},{abandon:!0}))}return new Promise((function(t){var n=setTimeout((function(){t(e())}),r);o.current={id:n,resolve:t}}))}},once:function(){return function(t){var r=t.current,n=t.runner,e=t.store;return e.current?new Promise((function(t){t(d(d({},r()),{},{abandon:!0}))})):(e.current=!0,n().then((function(t){return t.isError&&(e.current=!1),t})))}},error:function(t,r){var n=(r||{}).withAbandoned;return function(r){return(0,r.runner)().then((function(r){return!r.isError||r.abandon&&!n||t(r.error),r}))}}};function g(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function m(r){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?g(Object(e),!0).forEach((function(n){t(r,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):g(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}var x=(0,c.createContext)(null);function O(t){var r=t.value,n=t.children;return(0,c.createElement)(x.Provider,{value:r},n)}function j(){return(0,c.useContext)(x)}function w(t,r){if(!("function"==typeof t.pipe))return[l,t,r];var n=u(t.effect,2);return[t,n[0],n[1]||r]}function S(t){return function(){var r=t();if(!r||"function"!=typeof r.then)throw new Error("The callback have to return a promise object.");return r.then((function(t){return{data:t,error:void 0,isError:!1}}),(function(t){return{error:t,isError:!0}}))}}function P(t,r){return e(r).reverse().reduce((function(r,n,e){var o=t[e]||{current:void 0};return function(t){if(null==n)return r(t);return n(m(m({},t),{},{store:o,runner:function(){return r(t)}}))}}),(function(t){return t.runner()}))}function E(t){return Array.isArray(t)?t:[t]}function T(t,r){var n=u(w(t,Array.isArray(r)?{variables:r}:r),3),o=n[0],i=n[1],f=n[2],s=o===l?[o,{data:void 0,isError:!1,isFetching:!1,abandon:!1}]:[o],p=a.useModel.apply(void 0,e(s)),v=j(),y=f||{},h=y.variables,d=y.deps,b=y.manual,g=y.strategy,x=y.primaryStrategy,O=void 0===x?v:x,T=!d&&!h||b,A=E(g),R=E(O),C=A.concat(R),D=S((function(){return i.apply(void 0,e(h||[]))})),I=(0,c.useRef)({}),M=(0,c.useRef)(C.map((function(){return{current:void 0}}))),_=(0,c.useRef)(0),F=function(){var t=_.current+1;_.current=t;var r=p.state;return(0,p.setState)(m(m({},r),{},{isFetching:!0,fetchingKey:I.current})),D().then((function(r){var n=t!==_.current;return m(m(m({},p.state),r),{},{abandon:n,isFetching:!1,fetchingKey:void 0})}))},N=function(t){var r={current:function(){return p.state},variables:h,runner:t,store:M};return P(M.current,C)(r)},k=function(){return N(F).then((function(t){return t.abandon||p.setState(t),t}))};(0,c.useLayoutEffect)((function(){if(!T){var t=p.state.fetchingKey;t&&t!==I.current||function(){var t=p.state.fetchingKey;t&&t!==I.current||N(F).then((function(t){return t.abandon||p.setState(t),t}))}()}}),d||h||[]);var L=(0,c.useRef)(p.version);return(0,c.useEffect)((function(){L.current!==p.version&&(L.current=p.version,k())}),[p.version]),[p.state,k]}function A(t,r){var n=u(w(t,Array.isArray(r)?{variables:r}:r),3),o=n[0],i=n[1],f=n[2],s=o===l?[o,{data:void 0,isError:!1,isFetching:!1,abandon:!1}]:[o],p=a.useModel.apply(void 0,e(s)),v=j(),y=f||{},h=y.variables,d=y.strategy,b=y.primaryStrategy,g=void 0===b?v:b,x=E(d),O=E(g),T=x.concat(O),A=S((function(){return i.apply(void 0,e(h||[]))})),R=(0,c.useRef)(T.map((function(){return{current:void 0}}))),C=(0,c.useRef)({}),D=(0,c.useRef)(!1),I=function(){if(D.current)return new Promise((function(t){t(m(m({},p.state),{},{abandon:!0}))}));D.current=!0;var t=p.state;return(0,p.setState)(m(m({},t),{},{isFetching:!0,fetchingKey:C.current})),A().then((function(t){return D.current=!1,m(m(m({},p.state),t),{},{isFetching:!1,fetchingKey:void 0})}))},M=function(){return(t=I,r={current:function(){return p.state},variables:h,runner:t,store:R},P(R.current,T)(r)).then((function(t){return t.abandon||p.setState(t),t}));var t,r},_=(0,c.useRef)(p.version);return(0,c.useEffect)((function(){_.current!==p.version&&(_.current=p.version,M())}),[p.version]),[p.state,M]}function R(t){return(0,a.useSelector)(t,(function(t){return[t.state,t.trigger]}))}var C=a.ModelProvider,D=a.withModelProvider}(),i}()}));

@@ -89,2 +89,7 @@ import { FactoryCollection, FactoryModel } from '@airma/react-state';

export declare const PrimaryStrategyProvider: FC<{
value: StrategyType | null | StrategyType[];
children?: ReactNode;
}>;
export declare function withEffectProvider(

@@ -96,5 +101,9 @@ models: FactoryCollection

export declare const Strategy = {
debounce: (op: { time: number }) => StrategyType,
once: () => StrategyType
export declare const Strategy: {
debounce: (op: { time: number } | number) => StrategyType;
once: () => StrategyType;
error: (
process: (e: unknown) => any,
option?: { withAbandoned?: boolean }
) => StrategyType;
};
{
"private": false,
"name": "@airma/react-effect",
"version": "15.1.3",
"version": "15.1.4",
"description": "This is a react async state management tool",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -444,3 +444,4 @@ [![npm][npm-image]][npm-url]

* manual - set manual `true`, means you want to execute the query manually, then the deps and variables change will not affect the query callback running.
* strategy - you can set a strategy function or a strategy array to make query callback running with the strategy you want, for example: `debounce`, `once`.
* strategy - you can set a strategy function or a strategy array to make query callback running with the strategy you want, for example: `debounce`, `once`. If it is an array, the query follows running order from outside to inside.
* primaryStrategy - the primaryStrategy provides final running strategies inside strategies. If you want to set strategies, please use `strategy` option, this option is often setted for replacing the global primaryStrategy from `PrimaryStrategyProvider`.

@@ -477,3 +478,4 @@ returns:

* variables - you can set an array as parameters for query, when the elements change, the mutation callback runs.
* strategy - you can set a strategy function or a strategy array to make query callback running with the strategy you want, for example: `debounce`, `once`.
* strategy - you can set a strategy function or a strategy array to make query callback running with the strategy you want, for example: `debounce`, `once`. If it is an array, the query follows running order from outside to inside.
* primaryStrategy - the primaryStrategy provides final running strategies inside strategies. If you want to set strategies, please use `strategy` option, this option is often setted for replacing the global primaryStrategy from `PrimaryStrategyProvider`.

@@ -541,2 +543,40 @@ returns:

### PrimaryStrategyProvider
It is a react `Provider` for setting global primaryStrategy for every `useQuery` and `useMutation` in `children`.
```ts
import {
PrimaryStrategyProvider,
Strategy,
useQuery
} from '@airma/react-effect';
const App = ()=>{
// if the `fetchUsers` is failed,
// the global primary `Strategy.error` works.
useQuery(fetchUsers, [data]);
useQuery(fetchGroups, {
variables: [...ids],
strategy: [
Strategy.debounce(300),
Strategy.error(...)
],
// use a local null primmaryStrategy,
// so, the global one can not affect this
// query.
primmaryStrategy: null
});
......
}
......
{/* Set a primaryStrategy */}
<PrimaryStrategyProvider
value={Strategy.error(e => console.log(e))}
>
</PrimaryStrategyProvider>
```
### Strategy

@@ -547,13 +587,36 @@

```ts
const Strategy = {
debounce: (op: { time: number }) => StrategyType,
const Strategy:{
debounce: (op: { time: number } | number) => StrategyType,
once: () => StrategyType
error: (
process: (e: unknown) => any,
option?: { withAbandoned?: boolean }
) => StrategyType;
};
```
You can use it to the config `strategy` in `useQuery` and `useMutation`.
You can use it to the config `strategy` in `useQuery` and `useMutation`.
For example:
```ts
import {
Strategy,
useQuery
} from '@airma/react-effect';
const useUserList = (...ids:number[])=>{
useQuery(fetchUsers, {
variables: [...ids],
strategy: [
Strategy.debounce(300),
Strategy.error((e) =>console.log(e))
]
})
};
```
#### debounce
you can set a debounce time to it. like:
you can set a debounce running time to it. like:

@@ -573,2 +636,39 @@ ```ts

#### error
You can set a callback to process the error information from promise rejection.
Use it as a global primary strategy can help you reduce the codes for dealing a common error process.
```ts
import {
Strategy,
PrimaryStrategyProvider
} from '@airma/react-effect';
const primary = Strategy.error((e) =>console.log(e));
<PrimaryStrategyProvider value={primary}>
......
</PrimaryStrategyProvider>
```
By the default, it only process the error result which is not abandoned. You can set `{withAbandoned: true}` for dealing includes the abandoned errors.
```ts
import {
Strategy,
PrimaryStrategyProvider
} from '@airma/react-effect';
const primary = Strategy.error(
(e) =>console.log(e),
{withAbandoned: true}
);
<PrimaryStrategyProvider value={primary}>
......
</PrimaryStrategyProvider>
```
## Write Strategy

@@ -575,0 +675,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc