state-decorator 7.2.0 → 7.3.0-optim.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/development.d.ts +10 -10
  2. package/development.js +1 -1
  3. package/development.js.map +1 -1
  4. package/es/development.d.ts +10 -10
  5. package/es/development.js +1 -1
  6. package/es/development.js.map +1 -1
  7. package/es/graph.d.ts +8 -8
  8. package/es/helpers.d.ts +67 -67
  9. package/es/helpers.js +1 -1
  10. package/es/helpers.js.map +1 -1
  11. package/es/impl.d.ts +209 -199
  12. package/es/impl.js +1 -1
  13. package/es/impl.js.map +1 -1
  14. package/es/index.d.ts +169 -169
  15. package/es/index.js +1 -1
  16. package/es/index.js.map +1 -1
  17. package/es/middlewares.d.ts +3 -3
  18. package/es/middlewares.js +1 -1
  19. package/es/middlewares.js.map +1 -1
  20. package/es/shallow.d.ts +1 -1
  21. package/es/test.d.ts +122 -122
  22. package/es/test.js +1 -1
  23. package/es/test.js.map +1 -1
  24. package/es/types.d.ts +386 -386
  25. package/es/v5.d.ts +45 -45
  26. package/es/v5.js +1 -1
  27. package/es/v5.js.map +1 -1
  28. package/es/v5_test.d.ts +57 -57
  29. package/es/v5_test.js +1 -1
  30. package/es/v5_test.js.map +1 -1
  31. package/es/v5_types.d.ts +213 -213
  32. package/es/v6.d.ts +21 -21
  33. package/es/v6.js +1 -1
  34. package/es/v6.js.map +1 -1
  35. package/graph.d.ts +8 -8
  36. package/helpers.d.ts +67 -67
  37. package/helpers.js +1 -1
  38. package/helpers.js.map +1 -1
  39. package/impl.d.ts +209 -199
  40. package/impl.js +1 -1
  41. package/impl.js.map +1 -1
  42. package/index.d.ts +169 -169
  43. package/index.js +1 -1
  44. package/index.js.map +1 -1
  45. package/middlewares.d.ts +3 -3
  46. package/middlewares.js +1 -1
  47. package/middlewares.js.map +1 -1
  48. package/package.json +1 -1
  49. package/shallow.d.ts +1 -1
  50. package/test.d.ts +122 -122
  51. package/test.js +1 -1
  52. package/test.js.map +1 -1
  53. package/types.d.ts +386 -386
  54. package/v5.d.ts +45 -45
  55. package/v5.js +1 -1
  56. package/v5.js.map +1 -1
  57. package/v5_test.d.ts +57 -57
  58. package/v5_test.js +1 -1
  59. package/v5_test.js.map +1 -1
  60. package/v5_types.d.ts +213 -213
  61. package/v6.d.ts +21 -21
  62. package/v6.js +1 -1
  63. package/v6.js.map +1 -1
package/impl.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"impl.js","sources":["../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.push(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.push(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","pop","push","__spreadArray","to","from","pack","ar","l","slice","concat"],"mappings":"oEAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAE,GACzE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,KACzFP,EAAcC,EAAGC,EAC5B,EAEO,SAASS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,CAAI,CADvCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,EACnF,CAEO,IAAII,EAAW,WAQlB,OAPAA,EAAWf,OAAOgB,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIf,KADTc,EAAIG,UAAUF,GACOnB,OAAOK,UAAUC,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AGrB,GAAIQ,EAAI,CAAE,CAAW,QAAED,EAAI1B,EAAI,CAAI,CAC1D,GAAY,EAARwC,EAAG,GAAQ,MAAMA,EAAG,GAAI,MAAO,CAAExB,MAAOwB,EAAG,GAAKA,EAAG,QAAK,EAAQlB,MAAM,EAC7E,CAtB+CL,CAAK,CAACd,EAAGoC,GAAM,CAAG,CAuBtE,CA+DO,SAASI,EAAcC,EAAIC,EAAMC,GACpC,GAAIA,GAA6B,IAArB1C,UAAUC,OAAc,IAAK,IAA4B0C,EAAxB7C,EAAI,EAAG8C,EAAIH,EAAKxC,OAAYH,EAAI8C,EAAG9C,KACxE6C,GAAQ7C,KAAK2C,IACRE,IAAIA,EAAK7D,MAAME,UAAU6D,MAAM3D,KAAKuD,EAAM,EAAG3C,IAClD6C,EAAG7C,GAAK2C,EAAK3C,IAGrB,OAAO0C,EAAGM,OAAOH,GAAM7D,MAAME,UAAU6D,MAAM3D,KAAKuD,GACtD"}
1
+ {"version":3,"file":"impl.js","sources":["../node_modules/tslib/tslib.es6.mjs"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","pop","push","__spreadArray","to","from","pack","ar","l","slice","concat","SuppressedError"],"mappings":"oEAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI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C,EAAK3C,IAGrB,OAAO0C,EAAGM,OAAOH,GAAM7D,MAAME,UAAU6D,MAAM3D,KAAKuD,GACpD,CA8FkD,mBAApBM,iBAAiCA"}
package/index.d.ts CHANGED
@@ -1,169 +1,169 @@
1
- import { Context } from 'react';
2
- import { setGlobalConfig, GlobalConfig, ParallelActionError, EffectError } from './impl';
3
- import type { DecoratedActions, StoreActions, AsyncAction, SyncAction, SimpleSyncAction, LoadingMap, ErrorMap, LoadingParallelMap, ErrorParallelMap, StoreOptions, AsyncActionPromise, InvocationContext, GetPromiseInvocationContext, EffectsInvocationContext, InvocationContextActions, WarningNotifyFunc, ErrorEffectsInvocationContext, OnMountInvocationContext, ContextBase, OnPropsChangeEffectsContext, ContextState, Middleware, AbortActionCallback, LoadingProps, ErrorProps, LoadingMapProps, StoreConfig, ClearErrorFunc } from './types';
4
- import { ConflictPolicy } from './types';
5
- export type { DecoratedActions, StoreActions, LoadingMap, ErrorMap, LoadingParallelMap, ErrorParallelMap, StoreOptions, AsyncActionPromise as AsynchActionPromise, InvocationContext, GetPromiseInvocationContext, EffectsInvocationContext, InvocationContextActions, WarningNotifyFunc, ErrorEffectsInvocationContext, OnMountInvocationContext, ContextBase, OnPropsChangeEffectsContext, SyncAction, AsyncAction, SimpleSyncAction, ContextState, GlobalConfig, Middleware, LoadingProps, AbortActionCallback, ErrorProps, LoadingMapProps, StoreConfig, };
6
- export { setGlobalConfig, EffectError, ParallelActionError, ConflictPolicy };
7
- export type IsLoadingFunc<A> = (...props: (keyof A | [keyof A, string])[]) => boolean;
8
- type StateListenerUnregister = () => void;
9
- export type StoreApi<S, A extends DecoratedActions, P, DS = {}> = {
10
- /**
11
- * The current store state (with derived state if any).
12
- */
13
- readonly state: S & DS;
14
- /**
15
- * The store decorator (ie. ready to use) actions.
16
- */
17
- readonly actions: A;
18
- /**
19
- * A boolean that indicates that at least one asynchronous action is loading.
20
- */
21
- readonly loading: boolean;
22
- /**
23
- * A map of loading actions map (computed on property access)
24
- */
25
- readonly loadingMap: LoadingMap<A>;
26
- /**
27
- * A map of loading actions map (computed on property access)
28
- */
29
- readonly errorMap: ErrorMap<A>;
30
- /**
31
- * A map of parallel loading actions map (computed on property access)
32
- */
33
- readonly loadingParallelMap: LoadingParallelMap<A>;
34
- /**
35
- * A map of parallel actions error map (computed on property access)
36
- */
37
- readonly errorParallelMap: ErrorParallelMap<A>;
38
- /**
39
- * Initializes the store with the specified props
40
- */
41
- readonly init: (p: P) => void;
42
- /**
43
- * Update the store with the specified props
44
- */
45
- readonly setProps: (p: P) => void;
46
- /**
47
- * Destroy the store
48
- */
49
- readonly destroy: () => void;
50
- /**
51
- * Abort an asynchronous action marked as abortable.
52
- */
53
- readonly abortAction: (actionName: keyof A, promiseId?: string) => boolean;
54
- /**
55
- * Add a store state change listener
56
- */
57
- readonly addStateListener: (listener: StateListener) => StateListenerUnregister;
58
- /**
59
- * A function that takes a list of action names or a tuple of [action name, promiseId] and returns <code>true</code> if any action is loading.
60
- */
61
- readonly isLoading: IsLoadingFunc<A>;
62
- /**
63
- * A function to clear error on an action marked as <code>isErrorManaged: true</code>.
64
- */
65
- readonly clearError: ClearErrorFunc<A>;
66
- /**
67
- * @returns The store configuration
68
- */
69
- getConfig: () => StoreConfig<S, A, P, DS>;
70
- /**
71
- * Invoke onMountDeferred + onPropChange flagged onMountDeferred
72
- * @internal
73
- */
74
- invokeOnMountDeferred: () => void;
75
- /**
76
- * Returns a snapshot of the current state of the store.
77
- */
78
- getSnapshot(): StateListenerContext<S, DS, A>;
79
- };
80
- export type StateListenerContext<S, DS, A extends DecoratedActions> = S & DS & A & Pick<StoreApi<S, A, any, DS>, 'loading' | 'loadingMap' | 'errorParallelMap' | 'errorMap' | 'isLoading' | 'abortAction'>;
81
- export type StateListener = () => void;
82
- /**
83
- * Create a new store.
84
- * @param config Store configuration
85
- * @returns a store.
86
- */
87
- export declare function createStore<S, A extends DecoratedActions, P, DS = {}>(config: StoreConfig<S, A, P, DS>): StoreApi<S, A, P, DS>;
88
- /**
89
- * A react hook to get a state slice. Will be refresh if, and only if, one property of the slice has changed
90
- * @param store The store to listen to.
91
- * @param slicerFunc A function that returns a state slice
92
- * @returns The state slice.
93
- */
94
- export declare function useStoreSlice<S, A extends DecoratedActions, P, DS, SLICE>(store: StoreApi<S, A, P, DS>, slicerFunc: (ctx: StateListenerContext<S, DS, A>) => SLICE): SLICE;
95
- /**
96
- * A react hook to get a state slice. Will be refresh if, and only if, one property of the slice has changed
97
- * @param store The store to listen to.
98
- * @param properties list of properties to extract from store
99
- * @returns The state slice.
100
- */
101
- export declare function useStoreSlice<S, A extends DecoratedActions, P, DS, K extends keyof StateListenerContext<S, DS, A>, KL extends keyof A>(store: StoreApi<S, A, P, DS>, properties: K[]): Pick<StateListenerContext<S, DS, A>, K> & {
102
- loadingMap: LoadingMap<Pick<A, KL>>;
103
- };
104
- /**
105
- * Binds the store to this component.
106
- * Store will NOT be destroyed when component is unmouted.
107
- * The component will be refreshed for every change in the store.
108
- *
109
- * @param store The store to listen to.
110
- * @returns The store.
111
- */
112
- export declare function useStore<S, A extends DecoratedActions, P, DS>(store: StoreApi<S, A, P, DS>): StoreApi<S, A, P, DS>;
113
- /**
114
- * A react hook to get a state slice from a store context.
115
- * The component be refreshed if, and only if, one property of the slice has changed.
116
- * @param store The store to listen to.
117
- * @param slicerFunc A function that returns a state slice
118
- * @returns The state slice.
119
- */
120
- export declare function useStoreContextSlice<S, A extends DecoratedActions, P, DS, SLICE>(storeContext: Context<StoreApi<S, A, P, DS>>, slicerFunc: (ctx: StateListenerContext<S, DS, A>) => SLICE): SLICE;
121
- /**
122
- * A react hook to get a state slice from a store context.
123
- * The component will be refreshed if, and only if, one property of the slice has changed.
124
- * @param store The store to listen to.
125
- * @param properties list of properties to extract from store
126
- * @returns The state slice.
127
- */
128
- export declare function useStoreContextSlice<S, A extends DecoratedActions, P, DS, K extends keyof StateListenerContext<S, DS, A>, KL extends keyof A>(storeContext: Context<StoreApi<S, A, P, DS>>, properties: K[]): Pick<StateListenerContext<S, DS, A>, K> & {
129
- loadingMap: LoadingMap<Pick<A, KL>>;
130
- };
131
- /**
132
- * Creates and manages a local store.
133
- * The component will be refreshed for every change in the store.
134
- * Store will NOT be destroyed when component is unmouted.
135
- *
136
- * @param getInitialState Function to compute initial state from props.
137
- * @param props Owner component props to update state or react on prop changes
138
- * @param refreshOnUpdate Whether refresh the component if store state changes.
139
- * @returns The Store
140
- */
141
- export declare function useLocalStore<S, A extends DecoratedActions, P, DS = {}>(config: StoreConfig<S, A, P, DS>, props?: P, refreshOnUpdate?: boolean): StoreApi<S, A, P, DS>;
142
- /**
143
- * Binds a store to a component and inject props.
144
- * This hook must be the only one used with this store (or else props will the set several times).
145
- * The component will be refreshed for every change in the store.
146
- * Store will NOT be destroyed when component is unmouted.
147
- *
148
- * @param getInitialState Function to compute initial state from props.
149
- * @param actionImpl Actions implementation.
150
- * @param props Owner component props to update state or react on prop changes
151
- * @returns the Store.
152
- */
153
- export declare function useBindStore<S, A extends DecoratedActions, P, DS = {}>(store: StoreApi<S, A, P, DS>, props?: P): StoreApi<S, A, P, DS>;
154
- export default useLocalStore;
155
- /**
156
- * Creates a new object by picking properties to the object passed a first parameter
157
- * @param obj Object to pick properties from
158
- * @param props Property names
159
- * @returns a new object containing only picked properties
160
- */
161
- export declare function pick<T, K extends keyof T>(obj: T, props: K[]): Pick<T, K>;
162
- /**
163
- * Returns a function that creates a new object by picking properties to the object passed as first parameter.
164
- * To be used in conjunction of <code>useStoreSlice</code> like in example:
165
- * const s = useStoreSlice(myStore, slice('list', 'addItem'));
166
- * @param props Property names
167
- * @returns a function to pick property from an passed object.
168
- */
169
- export declare function slice<T, K extends keyof T>(...props: K[]): (obj: T) => Pick<T, K>;
1
+ import { Context } from 'react';
2
+ import { setGlobalConfig, GlobalConfig, ParallelActionError, EffectError } from './impl';
3
+ import type { DecoratedActions, StoreActions, AsyncAction, SyncAction, SimpleSyncAction, LoadingMap, ErrorMap, LoadingParallelMap, ErrorParallelMap, StoreOptions, AsyncActionPromise, InvocationContext, GetPromiseInvocationContext, EffectsInvocationContext, InvocationContextActions, WarningNotifyFunc, ErrorEffectsInvocationContext, OnMountInvocationContext, ContextBase, OnPropsChangeEffectsContext, ContextState, Middleware, AbortActionCallback, LoadingProps, ErrorProps, LoadingMapProps, StoreConfig, ClearErrorFunc } from './types';
4
+ import { ConflictPolicy } from './types';
5
+ export type { DecoratedActions, StoreActions, LoadingMap, ErrorMap, LoadingParallelMap, ErrorParallelMap, StoreOptions, AsyncActionPromise as AsynchActionPromise, InvocationContext, GetPromiseInvocationContext, EffectsInvocationContext, InvocationContextActions, WarningNotifyFunc, ErrorEffectsInvocationContext, OnMountInvocationContext, ContextBase, OnPropsChangeEffectsContext, SyncAction, AsyncAction, SimpleSyncAction, ContextState, GlobalConfig, Middleware, LoadingProps, AbortActionCallback, ErrorProps, LoadingMapProps, StoreConfig, };
6
+ export { setGlobalConfig, EffectError, ParallelActionError, ConflictPolicy };
7
+ export type IsLoadingFunc<A> = (...props: (keyof A | [keyof A, string])[]) => boolean;
8
+ type StateListenerUnregister = () => void;
9
+ export type StoreApi<S, A extends DecoratedActions, P, DS = {}> = {
10
+ /**
11
+ * The current store state (with derived state if any).
12
+ */
13
+ readonly state: S & DS;
14
+ /**
15
+ * The store decorator (ie. ready to use) actions.
16
+ */
17
+ readonly actions: A;
18
+ /**
19
+ * A boolean that indicates that at least one asynchronous action is loading.
20
+ */
21
+ readonly loading: boolean;
22
+ /**
23
+ * A map of loading actions map (computed on property access)
24
+ */
25
+ readonly loadingMap: LoadingMap<A>;
26
+ /**
27
+ * A map of loading actions map (computed on property access)
28
+ */
29
+ readonly errorMap: ErrorMap<A>;
30
+ /**
31
+ * A map of parallel loading actions map (computed on property access)
32
+ */
33
+ readonly loadingParallelMap: LoadingParallelMap<A>;
34
+ /**
35
+ * A map of parallel actions error map (computed on property access)
36
+ */
37
+ readonly errorParallelMap: ErrorParallelMap<A>;
38
+ /**
39
+ * Initializes the store with the specified props
40
+ */
41
+ readonly init: (p: P) => void;
42
+ /**
43
+ * Update the store with the specified props
44
+ */
45
+ readonly setProps: (p: P) => void;
46
+ /**
47
+ * Destroy the store
48
+ */
49
+ readonly destroy: () => void;
50
+ /**
51
+ * Abort an asynchronous action marked as abortable.
52
+ */
53
+ readonly abortAction: (actionName: keyof A, promiseId?: string) => boolean;
54
+ /**
55
+ * Add a store state change listener
56
+ */
57
+ readonly addStateListener: (listener: StateListener) => StateListenerUnregister;
58
+ /**
59
+ * A function that takes a list of action names or a tuple of [action name, promiseId] and returns <code>true</code> if any action is loading.
60
+ */
61
+ readonly isLoading: IsLoadingFunc<A>;
62
+ /**
63
+ * A function to clear error on an action marked as <code>isErrorManaged: true</code>.
64
+ */
65
+ readonly clearError: ClearErrorFunc<A>;
66
+ /**
67
+ * @returns The store configuration
68
+ */
69
+ getConfig: () => StoreConfig<S, A, P, DS>;
70
+ /**
71
+ * Invoke onMountDeferred + onPropChange flagged onMountDeferred
72
+ * @internal
73
+ */
74
+ invokeOnMountDeferred: () => void;
75
+ /**
76
+ * Returns a snapshot of the current state of the store.
77
+ */
78
+ getSnapshot(): StateListenerContext<S, DS, A, P>;
79
+ };
80
+ export type StateListenerContext<S, DS, A extends DecoratedActions, P> = P & S & DS & A & Pick<StoreApi<S, A, any, DS>, 'loading' | 'loadingMap' | 'errorParallelMap' | 'errorMap' | 'isLoading' | 'abortAction'>;
81
+ export type StateListener = () => void;
82
+ /**
83
+ * Create a new store.
84
+ * @param config Store configuration
85
+ * @returns a store.
86
+ */
87
+ export declare function createStore<S, A extends DecoratedActions, P, DS = {}>(config: StoreConfig<S, A, P, DS>): StoreApi<S, A, P, DS>;
88
+ /**
89
+ * A react hook to get a state slice. Will be refresh if, and only if, one property of the slice has changed
90
+ * @param store The store to listen to.
91
+ * @param slicerFunc A function that returns a state slice
92
+ * @returns The state slice.
93
+ */
94
+ export declare function useStoreSlice<S, A extends DecoratedActions, P, DS, SLICE>(store: StoreApi<S, A, P, DS>, slicerFunc: (ctx: StateListenerContext<S, DS, A, P>) => SLICE): SLICE;
95
+ /**
96
+ * A react hook to get a state slice. Will be refresh if, and only if, one property of the slice has changed
97
+ * @param store The store to listen to.
98
+ * @param properties list of properties to extract from store
99
+ * @returns The state slice.
100
+ */
101
+ export declare function useStoreSlice<S, A extends DecoratedActions, P, DS, K extends keyof StateListenerContext<S, DS, A, P>, KL extends keyof A>(store: StoreApi<S, A, P, DS>, properties: K[]): Pick<StateListenerContext<S, DS, A, P>, K> & {
102
+ loadingMap: LoadingMap<Pick<A, KL>>;
103
+ };
104
+ /**
105
+ * Binds the store to this component.
106
+ * Store will NOT be destroyed when component is unmouted.
107
+ * The component will be refreshed for every change in the store.
108
+ *
109
+ * @param store The store to listen to.
110
+ * @returns The store.
111
+ */
112
+ export declare function useStore<S, A extends DecoratedActions, P, DS>(store: StoreApi<S, A, P, DS>): StoreApi<S, A, P, DS>;
113
+ /**
114
+ * A react hook to get a state slice from a store context.
115
+ * The component be refreshed if, and only if, one property of the slice has changed.
116
+ * @param store The store to listen to.
117
+ * @param slicerFunc A function that returns a state slice
118
+ * @returns The state slice.
119
+ */
120
+ export declare function useStoreContextSlice<S, A extends DecoratedActions, P, DS, SLICE>(storeContext: Context<StoreApi<S, A, P, DS>>, slicerFunc: (ctx: StateListenerContext<S, DS, A, P>) => SLICE): SLICE;
121
+ /**
122
+ * A react hook to get a state slice from a store context.
123
+ * The component will be refreshed if, and only if, one property of the slice has changed.
124
+ * @param store The store to listen to.
125
+ * @param properties list of properties to extract from store
126
+ * @returns The state slice.
127
+ */
128
+ export declare function useStoreContextSlice<S, A extends DecoratedActions, P, DS, K extends keyof StateListenerContext<S, DS, A, P>, KL extends keyof A>(storeContext: Context<StoreApi<S, A, P, DS>>, properties: K[]): Pick<StateListenerContext<S, DS, A, P>, K> & {
129
+ loadingMap: LoadingMap<Pick<A, KL>>;
130
+ };
131
+ /**
132
+ * Creates and manages a local store.
133
+ * The component will be refreshed for every change in the store.
134
+ * Store will NOT be destroyed when component is unmouted.
135
+ *
136
+ * @param getInitialState Function to compute initial state from props.
137
+ * @param props Owner component props to update state or react on prop changes
138
+ * @param refreshOnUpdate Whether refresh the component if store state changes.
139
+ * @returns The Store
140
+ */
141
+ export declare function useLocalStore<S, A extends DecoratedActions, P, DS = {}>(config: StoreConfig<S, A, P, DS>, props?: P, refreshOnUpdate?: boolean): StoreApi<S, A, P, DS>;
142
+ /**
143
+ * Binds a store to a component and inject props.
144
+ * This hook must be the only one used with this store (or else props will the set several times).
145
+ * The component will be refreshed for every change in the store.
146
+ * Store will NOT be destroyed when component is unmouted.
147
+ *
148
+ * @param getInitialState Function to compute initial state from props.
149
+ * @param actionImpl Actions implementation.
150
+ * @param props Owner component props to update state or react on prop changes
151
+ * @returns the Store.
152
+ */
153
+ export declare function useBindStore<S, A extends DecoratedActions, P, DS = {}>(store: StoreApi<S, A, P, DS>, props?: P): StoreApi<S, A, P, DS>;
154
+ export default useLocalStore;
155
+ /**
156
+ * Creates a new object by picking properties to the object passed a first parameter
157
+ * @param obj Object to pick properties from
158
+ * @param props Property names
159
+ * @returns a new object containing only picked properties
160
+ */
161
+ export declare function pick<T, K extends keyof T>(obj: T, props: K[]): Pick<T, K>;
162
+ /**
163
+ * Returns a function that creates a new object by picking properties to the object passed as first parameter.
164
+ * To be used in conjunction of <code>useStoreSlice</code> like in example:
165
+ * const s = useStoreSlice(myStore, slice('list', 'addItem'));
166
+ * @param props Property names
167
+ * @returns a function to pick property from an passed object.
168
+ */
169
+ export declare function slice<T, K extends keyof T>(...props: K[]): (obj: T) => Pick<T, K>;
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./impl"),r=require("./development");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e),o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e},o.apply(this,arguments)};function c(e){var t={exports:{}};return e(t,t.exports),t.exports}var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=u.default.useState,l=u.default.useEffect,f=u.default.useLayoutEffect,s=u.default.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var v="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=a({inst:{value:r,getSnapshot:t}}),u=n[0].inst,o=n[1];return f((function(){u.value=r,u.getSnapshot=t,d(u)&&o({inst:u})}),[e,r,t]),l((function(){return d(u)&&o({inst:u}),e((function(){d(u)&&o({inst:u})}))}),[e]),s(r),r},p={useSyncExternalStore:void 0!==u.default.useSyncExternalStore?u.default.useSyncExternalStore:v},O=c((function(e,t){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=u.default,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),u=1;u<t;u++)n[u-1]=arguments[u];!function(e,t,n){var u=r.ReactDebugCurrentFrame.getStackAddendum();""!==u&&(t+="%s",n=n.concat([u]));var o=n.map((function(e){return String(e)}));o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}("error",e,n)}var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},c=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue,f=!1,s=!1;function d(e){var t=e.getSnapshot,r=e.value;try{var n=t();return!o(r,n)}catch(e){return!0}}var v=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,t,r){return t()}:function(t,r,u){f||void 0!==e.startTransition&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=r();if(!s){var p=r();o(v,p)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),s=!0)}var O=c({inst:{value:v,getSnapshot:r}}),_=O[0].inst,E=O[1];return a((function(){_.value=v,_.getSnapshot=r,d(_)&&E({inst:_})}),[t,v,r]),i((function(){d(_)&&E({inst:_});return t((function(){d(_)&&E({inst:_})}))}),[t]),l(v),v},p=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:v;t.useSyncExternalStore=p,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()})),_=p,E=O,S=c((function(e){"production"===process.env.NODE_ENV?e.exports=_:e.exports=E})),y=S;var g,L="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},b=S.useSyncExternalStore,A=u.default.useRef,h=u.default.useEffect,R=u.default.useMemo,x=u.default.useDebugValue,D={useSyncExternalStoreWithSelector:function(e,t,r,n,u){var o=A(null);if(null===o.current){var c={hasValue:!1,value:null};o.current=c}else c=o.current;o=R((function(){function e(e){if(!a){if(a=!0,o=e,e=n(e),void 0!==u&&c.hasValue){var t=c.value;if(u(t,e))return i=t}return i=e}if(t=i,L(o,e))return t;var r=n(e);return void 0!==u&&u(t,r)?t:(o=e,i=r)}var o,i,a=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,r,n,u]);var i=b(e,o[0],o[1]);return h((function(){c.hasValue=!0,c.value=i}),[i]),x(i),i}},M=c((function(e,t){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=u.default,r=S;var n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,c=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,u,f){var s,d=c(null);null===d.current?(s={hasValue:!1,value:null},d.current=s):s=d.current;var v=a((function(){var e,o,c=!1,i=function(t){if(!c){c=!0,e=t;var r=u(t);if(void 0!==f&&s.hasValue){var i=s.value;if(f(i,r))return o=i,i}return o=r,r}var a=o;if(n(e,t))return a;var l=u(t);return void 0!==f&&f(a,l)?a:(e=t,o=l,l)},a=void 0===r?null:r;return[function(){return i(t())},null===a?void 0:function(){return i(a())}]}),[t,r,u,f]),p=v[0],O=v[1],_=o(e,p,O);return i((function(){s.hasValue=!0,s.value=_}),[_]),l(_),_},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()})),m=D,T=M,C=c((function(e){"production"===process.env.NODE_ENV?e.exports=m:e.exports=T}));exports.ConflictPolicy=void 0,(g=exports.ConflictPolicy||(exports.ConflictPolicy={})).REJECT="reject",g.IGNORE="ignore",g.KEEP_LAST="keepLast",g.KEEP_ALL="keepAll",g.PARALLEL="parallel",g.REUSE="reuse",g.ABORT="abort";var j=C.useSyncExternalStoreWithSelector,w=y.useSyncExternalStore;function P(e){var n=t.createRef(),u=t.createRef(),c=t.createRef(),i=t.createRef(),a=t.createRef(),l=t.createRef(),f=t.createRef(),s=t.createRef(),d=t.createRef(),v=t.createRef(),p=t.createRef(),O=t.createRef(!1),_=t.createRef(),E=t.createRef([]),S=e.actions,y=e.middlewares,g=void 0===y?[]:y,L=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]])}return r}(e,["actions","middlewares"]),b=t.isFuncConfig(e)?e.getInitialState:function(){return e.initialState},A={},h=0;function R(){_.current=o(o(o(o({},i.current),n.current),u.current.state),{isLoading:j,abortAction:w,loading:s.current,loadingMap:f.current,loadingParallelMap:l.current,errorMap:P(),errorParallelMap:d.current}),Object.keys(A).forEach((function(e){var t;null===(t=A[e])||void 0===t||t.call(A)}))}function x(e){n.current=e,t.computeDerivedValues(n,c,u,L),R()}function D(e){l.current=e,f.current=function(){if(O.current){var e=l.current;return Object.keys(e).reduce((function(t,r){var n=e[r];return t[r]=null!=Object.keys(n).find((function(e){return!!n[e]})),t}),{})}return null}(),s.current=function(){if(O.current){var e=l.current;return null!=Object.keys(e).find((function(t){var r=e[t];return Object.keys(r).find((function(e){return!!r[e]}))}))}return null}()}function M(o){var l;if(!O.current){c.current=o,O.current=!0,n.current=b(o);var f=new Set(null==L?void 0:L.initialActionsMarkedLoading),s=Object.keys(S).reduce((function(e,r){var n;return e[r]=f.has(r)?((n={})[t.DEFAULT_PROMISE_ID]=!0,n):{},e}),{});D(s),d.current=Object.keys(S).reduce((function(e,t){return e[t]={},e}),{}),a.current={},v.current={},p.current={},u.current={state:null,deps:{}},(null==L?void 0:L.derivedState)&&t.fixDerivedDeps(L),E.current=[];var _={options:L,get state(){return n.current},actions:S,setState:x};e.logEnabled&&r.logDetailedEffects&&g.push(r.logDetailedEffects());var y=function(e){var t,r=e();E.current.push(r),null===(t=r.init)||void 0===t||t.call(r,_)};null===(l=t.globalConfig.defaultMiddlewares)||void 0===l||l.forEach(y),null==g||g.forEach(y),t.computeDerivedValues(n,c,u,L),t.onPropChange(n,u,c,null,i,L,b,T,!0,!1),(null==L?void 0:L.onMount)&&L.onMount(t.buildOnMountInvocationContext(n,u,c,i)),R()}}function m(e,r){void 0===r&&(r=t.DEFAULT_PROMISE_ID);var n=d.current[e];(null==n?void 0:n[r])&&delete n[r],R()}function T(e,r,o,i,a,f,s,d){void 0===s&&(s=!1),void 0===d&&(d=!1);var v=!1;if(O.current){var p=r,_=!!a&&t.isLoadingImpl(p||l.current,[o,null==f?void 0:f.promiseId]),S=t.runMiddlewares(E.current,n.current,e,_,o,i,a,f),y=S.newState,g=S.newLoading;if(null!=y&&(v=!0,n.current=y),_!==g&&(p=t.buildLoadingMap(p,o,(null==f?void 0:f.promiseId)||t.DEFAULT_PROMISE_ID,g),0===Object.keys(p).length&&(p=void 0)),null!=p&&(v=!0,D(p)),v)t.computeDerivedValues(n,c,u,L),d||(n.current=y||n.current,R());else if(s){t.computeDerivedValues(n,c,u,L)&&!d&&R()}}}var C=Object.keys(S);function j(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.isLoadingImpl.apply(void 0,function(e,t,r){if(r||2===arguments.length)for(var n,u=0,o=t.length;u<o;u++)!n&&u in t||(n||(n=Array.prototype.slice.call(t,0,u)),n[u]=t[u]);return e.concat(n||Array.prototype.slice.call(t))}([l.current],e,!1))}function w(e,r){var n,u;void 0===r&&(r=t.DEFAULT_PROMISE_ID);var o=null===(u=null===(n=v.current[e])||void 0===n?void 0:n[r])||void 0===u?void 0:u.abortController,c=!1;return o&&(o.abort(),c=!0),c}function P(){return O.current?t.buildErrorMap(d.current):null}return i.current=C.reduce((function(e,r){var o=S[r];return t.isSimpleSyncAction(o)?e[r]=t.decorateSimpleSyncAction(r,o,n,u,c,O,L,T):t.isAsyncAction(o)?e[r]=t.decorateAsyncAction({actionName:r,stateRef:n,derivedStateRef:u,propsRef:c,loadingParallelMapRef:l,errorMapRef:d,actionsRef:i,promisesRef:v,conflictActionsRef:p,initializedRef:O,options:L,setState:T,clearError:m,action:t.computeAsyncActionInput(o)}):t.isSyncAction(o)&&(e[r]=t.decorateSyncAction(r,o,n,u,c,i,O,a,L,T,m)),e}),{}),{getConfig:function(){return o({},e)},setProps:function(e){var r=c.current;c.current=e,O.current?t.onPropChange(n,u,c,r,i,L,b,T,!1,!1):M(e)},addStateListener:function(e){var t="".concat(h++);return A[t]=e,function(){delete A[t]}},init:M,destroy:function(){var e;if(O.current){var r=Object.keys(S).reduce((function(e,r){var n=S[r];if(t.isAsyncAction(n)&&n.abortable){var u=l.current[r],o=Object.keys(u).reduce((function(e,t){return u[t]&&(w(r,t),e.push(t)),e}),[]);o.length>0&&(e[r]=o)}return e}),{});null===(e=null==L?void 0:L.onUnmount)||void 0===e||e.call(L,t.buildOnUnMountInvocationContext(n,u,c,r)),c.current=null,n.current=null,l.current=null,f.current=null,s.current=null,d.current=null,v.current=null,p.current=null,u.current=null,_.current=null,Object.keys(a.current).forEach((function(e){clearTimeout(a.current[e])})),a.current=null,A={},O.current=!1,E.current.forEach((function(e){var t;null===(t=e.destroy)||void 0===t||t.call(e)})),E.current=[]}},isLoading:j,abortAction:w,clearError:m,getSnapshot:function(){return _.current},invokeOnMountDeferred:function(){t.onPropChange(n,u,c,null,i,L,b,T,!0,!0),(null==L?void 0:L.onMountDeferred)&&L.onMountDeferred(t.buildOnMountInvocationContext(n,u,c,i))},get actions(){return i.current},get state(){return O.current?o(o({},n.current),u.current.state):null},get loading(){return s.current},get loadingMap(){return f.current},get errorMap(){return P()},get loadingParallelMap(){return O.current?l.current:null},get errorParallelMap(){return O.current?d.current:null}}}function I(r,n){var u=e.useMemo((function(){return n instanceof Function?n:function(e){return k(e,n)}}),[n]);return j(r.addStateListener,r.getSnapshot,r.getSnapshot,u,t.globalConfig.comparator)}function V(t,r,n){void 0===n&&(n=!0);var u=e.useRef();return null==u.current&&(u.current=P(t)),e.useEffect((function(){return u.current.invokeOnMountDeferred(),function(){var e;null===(e=u.current)||void 0===e||e.destroy()}}),[]),function(t,r,n){void 0===r&&(r=null),void 0===n&&(n=!0);var u=e.useReducer((function(e){return e>100?0:e+1}),0)[1],o=e.useRef(t);return t.setProps(r),e.useLayoutEffect((function(){t.init(r)}),[]),e.useLayoutEffect((function(){if(n)return o.current.addStateListener((function(){u()}))}),[n]),t}(u.current,r,n)}function k(e,t){return t.reduce((function(t,r){return e.hasOwnProperty(r)&&(t[r]=e[r]),t}),{})}Object.defineProperty(exports,"EffectError",{enumerable:!0,get:function(){return t.EffectError}}),Object.defineProperty(exports,"ParallelActionError",{enumerable:!0,get:function(){return t.ParallelActionError}}),Object.defineProperty(exports,"setGlobalConfig",{enumerable:!0,get:function(){return t.setGlobalConfig}}),exports.createStore=P,exports.default=V,exports.pick=k,exports.slice=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return k(t,e)}},exports.useBindStore=function(t,r){return t.setProps(r),w(t.addStateListener,t.getSnapshot),e.useLayoutEffect((function(){t.init(r)}),[]),e.useEffect((function(){t.invokeOnMountDeferred()}),[t]),t},exports.useLocalStore=V,exports.useStore=function(e){return w(e.addStateListener,e.getSnapshot),e},exports.useStoreContextSlice=function(t,r){return I(e.useContext(t),r)},exports.useStoreSlice=I;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("./impl"),t=require("./development");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e),o=function(){return o=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var u in r=arguments[t])Object.prototype.hasOwnProperty.call(r,u)&&(e[u]=r[u]);return e},o.apply(this,arguments)};function c(e){var r={exports:{}};return e(r,r.exports),r.exports}"function"==typeof SuppressedError&&SuppressedError;var i="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},a=u.default.useState,l=u.default.useEffect,f=u.default.useLayoutEffect,s=u.default.useDebugValue;function d(e){var r=e.getSnapshot;e=e.value;try{var t=r();return!i(e,t)}catch(e){return!0}}var v="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,r){return r()}:function(e,r){var t=r(),n=a({inst:{value:t,getSnapshot:r}}),u=n[0].inst,o=n[1];return f((function(){u.value=t,u.getSnapshot=r,d(u)&&o({inst:u})}),[e,t,r]),l((function(){return d(u)&&o({inst:u}),e((function(){d(u)&&o({inst:u})}))}),[e]),s(t),t},p={useSyncExternalStore:void 0!==u.default.useSyncExternalStore?u.default.useSyncExternalStore:v},O=c((function(e,r){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=u.default,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),u=1;u<r;u++)n[u-1]=arguments[u];!function(e,r,n){var u=t.ReactDebugCurrentFrame.getStackAddendum();""!==u&&(r+="%s",n=n.concat([u]));var o=n.map((function(e){return String(e)}));o.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,o)}("error",e,n)}var o="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},c=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue,f=!1,s=!1;function d(e){var r=e.getSnapshot,t=e.value;try{var n=r();return!o(t,n)}catch(e){return!0}}var v=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,r,t){return r()}:function(r,t,u){f||void 0!==e.startTransition&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=t();if(!s){var p=t();o(v,p)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),s=!0)}var O=c({inst:{value:v,getSnapshot:t}}),_=O[0].inst,E=O[1];return a((function(){_.value=v,_.getSnapshot=t,d(_)&&E({inst:_})}),[r,v,t]),i((function(){d(_)&&E({inst:_});return r((function(){d(_)&&E({inst:_})}))}),[r]),l(v),v},p=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:v;r.useSyncExternalStore=p,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()})),_=p,E=O,S=c((function(e){"production"===process.env.NODE_ENV?e.exports=_:e.exports=E})),y=S;var g,L="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},b=S.useSyncExternalStore,A=u.default.useRef,R=u.default.useEffect,h=u.default.useMemo,x=u.default.useDebugValue,D={useSyncExternalStoreWithSelector:function(e,r,t,n,u){var o=A(null);if(null===o.current){var c={hasValue:!1,value:null};o.current=c}else c=o.current;o=h((function(){function e(e){if(!a){if(a=!0,o=e,e=n(e),void 0!==u&&c.hasValue){var r=c.value;if(u(r,e))return i=r}return i=e}if(r=i,L(o,e))return r;var t=n(e);return void 0!==u&&u(r,t)?r:(o=e,i=t)}var o,i,a=!1,l=void 0===t?null:t;return[function(){return e(r())},null===l?void 0:function(){return e(l())}]}),[r,t,n,u]);var i=b(e,o[0],o[1]);return R((function(){c.hasValue=!0,c.value=i}),[i]),x(i),i}},M=c((function(e,r){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=u.default,t=S;var n="function"==typeof Object.is?Object.is:function(e,r){return e===r&&(0!==e||1/e==1/r)||e!=e&&r!=r},o=t.useSyncExternalStore,c=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,r,t,u,f){var s,d=c(null);null===d.current?(s={hasValue:!1,value:null},d.current=s):s=d.current;var v=a((function(){var e,o,c=!1,i=function(r){if(!c){c=!0,e=r;var t=u(r);if(void 0!==f&&s.hasValue){var i=s.value;if(f(i,t))return o=i,i}return o=t,t}var a=o;if(n(e,r))return a;var l=u(r);return void 0!==f&&f(a,l)?a:(e=r,o=l,l)},a=void 0===t?null:t;return[function(){return i(r())},null===a?void 0:function(){return i(a())}]}),[r,t,u,f]),p=v[0],O=v[1],_=o(e,p,O);return i((function(){s.hasValue=!0,s.value=_}),[_]),l(_),_},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()})),m=D,T=M,C=c((function(e){"production"===process.env.NODE_ENV?e.exports=m:e.exports=T}));exports.ConflictPolicy=void 0,(g=exports.ConflictPolicy||(exports.ConflictPolicy={})).REJECT="reject",g.IGNORE="ignore",g.KEEP_LAST="keepLast",g.KEEP_ALL="keepAll",g.PARALLEL="parallel",g.REUSE="reuse",g.ABORT="abort";var j=C.useSyncExternalStoreWithSelector,w=y.useSyncExternalStore;function P(e){var n=r.createRef(),u=r.createRef(),c=r.createRef(),i=r.createRef(),a=r.createRef(),l=r.createRef(),f=r.createRef(),s=r.createRef(),d=r.createRef(),v=r.createRef(),p=r.createRef(),O=r.createRef(!1),_=r.createRef(!1),E=r.createRef(),S=r.createRef([]),y=e.actions,g=e.middlewares,L=void 0===g?[]:g,b=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(n=Object.getOwnPropertySymbols(e);u<n.length;u++)r.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(t[n[u]]=e[n[u]])}return t}(e,["actions","middlewares"]),A=r.isFuncConfig(e)?e.getInitialState:function(){return e.initialState},R={},h=0;function x(){E.current=o(o(o(o(o({},c.current),i.current),n.current),u.current.state),{isLoading:w,abortAction:P,loading:s.current,loadingMap:f.current,loadingParallelMap:l.current,errorMap:I(),errorParallelMap:d.current}),Object.keys(R).forEach((function(e){var r;null===(r=R[e])||void 0===r||r.call(R)}))}function D(e){n.current=e,r.computeDerivedValues(n,c,u,b),x()}function M(e){l.current=e,f.current=function(){if(O.current){var e=l.current;return Object.keys(e).reduce((function(r,t){var n=e[t];return r[t]=null!=Object.keys(n).find((function(e){return!!n[e]})),r}),{})}return null}(),s.current=function(){if(O.current){var e=l.current;return null!=Object.keys(e).find((function(r){var t=e[r];return Object.keys(t).find((function(e){return!!t[e]}))}))}return null}()}function m(o){var l;if(!O.current){c.current=o,O.current=!0,n.current=A(o);var f=new Set(null==b?void 0:b.initialActionsMarkedLoading),s=Object.keys(y).reduce((function(e,t){var n;return e[t]=f.has(t)?((n={})[r.DEFAULT_PROMISE_ID]=!0,n):{},e}),{});M(s),d.current=Object.keys(y).reduce((function(e,r){return e[r]={},e}),{}),a.current={},v.current={},p.current={},u.current={state:null,deps:{}},(null==b?void 0:b.derivedState)&&r.fixDerivedDeps(b),S.current=[];var _={options:b,get state(){return n.current},actions:y,setState:D};e.logEnabled&&t.logDetailedEffects&&L.push(t.logDetailedEffects());var E=function(e){var r,t=e();S.current.push(t),null===(r=t.init)||void 0===r||r.call(t,_)};null===(l=r.globalConfig.defaultMiddlewares)||void 0===l||l.forEach(E),null==L||L.forEach(E),r.computeDerivedValues(n,c,u,b),r.onPropChange(n,u,c,null,i,b,A,C,!0,!1),(null==b?void 0:b.onMount)&&b.onMount(r.buildOnMountInvocationContext(n,u,c,i)),x()}}function T(e,t){void 0===t&&(t=r.DEFAULT_PROMISE_ID);var n=d.current[e];(null==n?void 0:n[t])&&delete n[t],x()}function C(e,t,o,i,a,f,s,d,v){void 0===s&&(s=!1),void 0===d&&(d=!1),void 0===v&&(v=!1);var p=!1;if(!O.current)return x;var E=t,y=!!a&&r.isLoadingImpl(E||l.current,[o,null==f?void 0:f.promiseId]),g=r.runMiddlewares(S.current,n.current,e,y,o,i,a,f),L=g.newState,A=g.newLoading;if(null!=L&&(p=!0,n.current=L),y!==A&&(E=r.buildLoadingMap(E,o,(null==f?void 0:f.promiseId)||r.DEFAULT_PROMISE_ID,A),0===Object.keys(E).length&&(E=void 0)),null!=E&&(p=!0,M(E)),p)r.computeDerivedValues(n,c,u,b),d||(n.current=L||n.current,v||(_.current=!0,x()));else if(s){!r.computeDerivedValues(n,c,u,b)||d||v||(_.current=!0,x())}return x}var j=Object.keys(y);function w(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.isLoadingImpl.apply(void 0,function(e,r,t){if(t||2===arguments.length)for(var n,u=0,o=r.length;u<o;u++)!n&&u in r||(n||(n=Array.prototype.slice.call(r,0,u)),n[u]=r[u]);return e.concat(n||Array.prototype.slice.call(r))}([l.current],e,!1))}function P(e,t){var n,u;void 0===t&&(t=r.DEFAULT_PROMISE_ID);var o=null===(u=null===(n=v.current[e])||void 0===n?void 0:n[t])||void 0===u?void 0:u.abortController,c=!1;return o&&(o.abort(),c=!0),c}function I(){return O.current?r.buildErrorMap(d.current):null}return i.current=j.reduce((function(e,t){var o=y[t];return r.isSimpleSyncAction(o)?e[t]=r.decorateSimpleSyncAction(t,o,n,u,c,O,b,C):r.isAsyncAction(o)?e[t]=r.decorateAsyncAction({actionName:t,stateRef:n,derivedStateRef:u,propsRef:c,loadingParallelMapRef:l,errorMapRef:d,actionsRef:i,promisesRef:v,conflictActionsRef:p,initializedRef:O,stateFlagRef:_,options:b,setState:C,clearError:T,action:r.computeAsyncActionInput(o)}):r.isSyncAction(o)&&(e[t]=r.decorateSyncAction(t,o,n,u,c,i,O,a,b,C,T)),e}),{}),{getConfig:function(){return o({},e)},setProps:function(e){var t=c.current;c.current=e,O.current?r.onPropChange(n,u,c,t,i,b,A,C,!1,!1):m(e)},addStateListener:function(e){var r="".concat(h++);return R[r]=e,function(){delete R[r]}},init:m,destroy:function(){var e;if(O.current){var t=Object.keys(y).reduce((function(e,t){var n=y[t];if(r.isAsyncAction(n)&&n.abortable){var u=l.current[t],o=Object.keys(u).reduce((function(e,r){return u[r]&&(P(t,r),e.push(r)),e}),[]);o.length>0&&(e[t]=o)}return e}),{});null===(e=null==b?void 0:b.onUnmount)||void 0===e||e.call(b,r.buildOnUnMountInvocationContext(n,u,c,t)),Object.keys(a.current).forEach((function(e){clearTimeout(a.current[e])})),c.current=null,n.current=null,l.current=null,f.current=null,s.current=null,d.current=null,v.current=null,p.current=null,u.current=null,E.current=null,a.current=null,R={},O.current=!1,S.current.forEach((function(e){var r;null===(r=e.destroy)||void 0===r||r.call(e)})),S.current=[]}},isLoading:w,abortAction:P,clearError:T,getSnapshot:function(){return E.current},invokeOnMountDeferred:function(){r.onPropChange(n,u,c,null,i,b,A,C,!0,!0),(null==b?void 0:b.onMountDeferred)&&b.onMountDeferred(r.buildOnMountInvocationContext(n,u,c,i))},get actions(){return i.current},get state(){return O.current?o(o({},n.current),u.current.state):null},get loading(){return s.current},get loadingMap(){return f.current},get errorMap(){return I()},get loadingParallelMap(){return O.current?l.current:null},get errorParallelMap(){return O.current?d.current:null}}}function I(t,n){var u=e.useMemo((function(){return n instanceof Function?n:function(e){return k(e,n)}}),[n]);return j(t.addStateListener,t.getSnapshot,void 0,u,r.globalConfig.comparator)}function V(r,t,n){void 0===n&&(n=!0);var u=e.useRef();return null==u.current&&(u.current=P(r)),e.useEffect((function(){return u.current.invokeOnMountDeferred(),function(){var e;null===(e=u.current)||void 0===e||e.destroy()}}),[]),function(r,t,n){void 0===t&&(t=null),void 0===n&&(n=!0);var u=e.useReducer((function(e){return e>100?0:e+1}),0)[1],o=e.useRef(r);return r.setProps(t),e.useLayoutEffect((function(){r.init(t)}),[]),e.useLayoutEffect((function(){if(n)return o.current.addStateListener((function(){u()}))}),[n]),r}(u.current,t,n)}function k(e,r){return r.reduce((function(r,t){return e.hasOwnProperty(t)&&(r[t]=e[t]),r}),{})}Object.defineProperty(exports,"EffectError",{enumerable:!0,get:function(){return r.EffectError}}),Object.defineProperty(exports,"ParallelActionError",{enumerable:!0,get:function(){return r.ParallelActionError}}),Object.defineProperty(exports,"setGlobalConfig",{enumerable:!0,get:function(){return r.setGlobalConfig}}),exports.createStore=P,exports.default=V,exports.pick=k,exports.slice=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return function(r){return k(r,e)}},exports.useBindStore=function(r,t){return r.setProps(t),w(r.addStateListener,r.getSnapshot),e.useLayoutEffect((function(){r.init(t)}),[]),e.useEffect((function(){r.invokeOnMountDeferred()}),[r]),r},exports.useLocalStore=V,exports.useStore=function(e){return w(e.addStateListener,e.getSnapshot),e},exports.useStoreContextSlice=function(r,t){return I(e.useContext(r),t)},exports.useStoreSlice=I;
2
2
  //# sourceMappingURL=index.js.map