@ngxs/store 3.7.6-dev.master-2df2f65 → 3.7.6-dev.master-1bdb8c0

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 (78) hide show
  1. package/bundles/ngxs-store-operators.umd.js +11 -11
  2. package/bundles/ngxs-store-operators.umd.js.map +1 -1
  3. package/bundles/ngxs-store-operators.umd.min.js.map +1 -1
  4. package/bundles/ngxs-store.umd.js +238 -75
  5. package/bundles/ngxs-store.umd.js.map +1 -1
  6. package/bundles/ngxs-store.umd.min.js +1 -1
  7. package/bundles/ngxs-store.umd.min.js.map +1 -1
  8. package/esm2015/index.js +2 -2
  9. package/esm2015/ngxs-store.js +15 -14
  10. package/esm2015/operators/append.js +2 -2
  11. package/esm2015/operators/compose.js +2 -2
  12. package/esm2015/operators/iif.js +7 -7
  13. package/esm2015/operators/index.js +1 -1
  14. package/esm2015/operators/insert-item.js +1 -1
  15. package/esm2015/operators/patch.js +4 -4
  16. package/esm2015/operators/remove-item.js +1 -1
  17. package/esm2015/operators/types.js +5 -0
  18. package/esm2015/operators/update-item.js +1 -1
  19. package/esm2015/operators/utils.js +1 -1
  20. package/esm2015/src/dev-features/ngxs-development.module.js +26 -0
  21. package/esm2015/src/dev-features/ngxs-unhandled-actions-logger.js +69 -0
  22. package/esm2015/src/dev-features/symbols.js +24 -0
  23. package/esm2015/src/internal/state-context-factory.js +2 -2
  24. package/esm2015/src/internal/state-factory.js +21 -5
  25. package/esm2015/src/internal/state-operators.js +1 -1
  26. package/esm2015/src/public_api.js +3 -1
  27. package/esm2015/src/symbols.js +1 -1
  28. package/esm5/index.js +2 -2
  29. package/esm5/ngxs-store.js +15 -14
  30. package/esm5/operators/append.js +2 -2
  31. package/esm5/operators/compose.js +2 -2
  32. package/esm5/operators/iif.js +7 -7
  33. package/esm5/operators/index.js +1 -1
  34. package/esm5/operators/insert-item.js +1 -1
  35. package/esm5/operators/patch.js +4 -4
  36. package/esm5/operators/remove-item.js +1 -1
  37. package/esm5/operators/types.js +5 -0
  38. package/esm5/operators/update-item.js +1 -1
  39. package/esm5/operators/utils.js +1 -1
  40. package/esm5/src/dev-features/ngxs-development.module.js +34 -0
  41. package/esm5/src/dev-features/ngxs-unhandled-actions-logger.js +98 -0
  42. package/esm5/src/dev-features/symbols.js +24 -0
  43. package/esm5/src/internal/state-context-factory.js +2 -2
  44. package/esm5/src/internal/state-factory.js +21 -5
  45. package/esm5/src/internal/state-operators.js +1 -1
  46. package/esm5/src/public_api.js +3 -1
  47. package/esm5/src/symbols.js +1 -1
  48. package/fesm2015/ngxs-store-operators.js +11 -11
  49. package/fesm2015/ngxs-store-operators.js.map +1 -1
  50. package/fesm2015/ngxs-store.js +171 -45
  51. package/fesm2015/ngxs-store.js.map +1 -1
  52. package/fesm5/ngxs-store-operators.js +11 -11
  53. package/fesm5/ngxs-store-operators.js.map +1 -1
  54. package/fesm5/ngxs-store.js +220 -60
  55. package/fesm5/ngxs-store.js.map +1 -1
  56. package/ngxs-store.d.ts +14 -13
  57. package/ngxs-store.metadata.json +1 -1
  58. package/operators/append.d.ts +2 -3
  59. package/operators/compose.d.ts +1 -2
  60. package/operators/iif.d.ts +3 -4
  61. package/operators/index.d.ts +2 -1
  62. package/operators/insert-item.d.ts +2 -3
  63. package/operators/ngxs-store-operators.metadata.json +1 -1
  64. package/operators/patch.d.ts +5 -4
  65. package/operators/remove-item.d.ts +3 -4
  66. package/operators/types.d.ts +53 -0
  67. package/operators/update-item.d.ts +3 -4
  68. package/operators/utils.d.ts +2 -4
  69. package/package.json +1 -1
  70. package/src/dev-features/ngxs-development.module.d.ts +5 -0
  71. package/src/dev-features/ngxs-unhandled-actions-logger.d.ts +14 -0
  72. package/src/dev-features/symbols.d.ts +8 -0
  73. package/src/internal/state-operators.d.ts +1 -1
  74. package/src/public_api.d.ts +3 -0
  75. package/src/symbols.d.ts +3 -2
  76. package/esm2015/operators/internals.js +0 -5
  77. package/esm5/operators/internals.js +0 -5
  78. package/operators/internals.d.ts +0 -2
@@ -20,7 +20,7 @@ function append(items) {
20
20
  /** @type {?} */
21
21
  var itemsNotProvidedButExistingIs = (!items || !items.length) && existing;
22
22
  if (itemsNotProvidedButExistingIs) {
23
- return (/** @type {?} */ (existing));
23
+ return (/** @type {?} */ (((/** @type {?} */ (existing)))));
24
24
  }
25
25
  if (Array.isArray(existing)) {
26
26
  return existing.concat((/** @type {?} */ (((/** @type {?} */ (items))))));
@@ -55,7 +55,7 @@ function compose() {
55
55
  * @param {?} operator
56
56
  * @return {?}
57
57
  */
58
- function (accumulator, operator) { return operator(accumulator); }), existing);
58
+ function (accumulator, operator) { return operator((/** @type {?} */ (accumulator))); }), (/** @type {?} */ (existing)));
59
59
  });
60
60
  }
61
61
 
@@ -116,7 +116,7 @@ function isNil(value) {
116
116
  /**
117
117
  * @template T
118
118
  * @param {?} operatorOrValue
119
- * @param {?=} existing
119
+ * @param {?} existing
120
120
  * @return {?}
121
121
  */
122
122
  function retrieveValue(operatorOrValue, existing) {
@@ -124,14 +124,14 @@ function retrieveValue(operatorOrValue, existing) {
124
124
  // then call it with an original value
125
125
  if (isStateOperator(operatorOrValue)) {
126
126
  /** @type {?} */
127
- var value = operatorOrValue((/** @type {?} */ ((/** @type {?} */ (existing)))));
127
+ var value = operatorOrValue(existing);
128
128
  return (/** @type {?} */ (value));
129
129
  }
130
130
  // If operator or value was not provided
131
131
  // e.g. `elseOperatorOrValue` is `undefined`
132
132
  // then we just return an original value
133
133
  if (isUndefined(operatorOrValue)) {
134
- return (/** @type {?} */ ((/** @type {?} */ (((/** @type {?} */ (existing)))))));
134
+ return (/** @type {?} */ (existing));
135
135
  }
136
136
  return (/** @type {?} */ (operatorOrValue));
137
137
  }
@@ -155,12 +155,12 @@ function iif(condition, trueOperatorOrValue, elseOperatorOrValue) {
155
155
  var result = !!condition;
156
156
  // but if it is a function then run it to get the result
157
157
  if (isPredicate(condition)) {
158
- result = condition(existing);
158
+ result = condition((/** @type {?} */ (existing)));
159
159
  }
160
160
  if (result) {
161
- return retrieveValue(trueOperatorOrValue, (/** @type {?} */ (existing)));
161
+ return retrieveValue((/** @type {?} */ (trueOperatorOrValue)), existing);
162
162
  }
163
- return retrieveValue((/** @type {?} */ (elseOperatorOrValue)), (/** @type {?} */ (existing)));
163
+ return retrieveValue((/** @type {?} */ ((/** @type {?} */ (elseOperatorOrValue)))), existing);
164
164
  });
165
165
  }
166
166
 
@@ -214,7 +214,7 @@ function insertItem(value, beforePosition) {
214
214
  * @return {?}
215
215
  */
216
216
  function patch(patchObject) {
217
- return (/** @type {?} */ (((/** @type {?} */ ((/**
217
+ return (/**
218
218
  * @param {?} existing
219
219
  * @return {?}
220
220
  */
@@ -225,7 +225,7 @@ function patch(patchObject) {
225
225
  /** @type {?} */
226
226
  var newValue = patchObject[k];
227
227
  /** @type {?} */
228
- var existingPropValue = existing[(/** @type {?} */ (k))];
228
+ var existingPropValue = existing[k];
229
229
  /** @type {?} */
230
230
  var newPropValue = isStateOperator(newValue)
231
231
  ? newValue((/** @type {?} */ (existingPropValue)))
@@ -238,7 +238,7 @@ function patch(patchObject) {
238
238
  }
239
239
  }
240
240
  return clone || existing;
241
- }))))));
241
+ });
242
242
  }
243
243
 
244
244
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-operators.js","sources":["ng://@ngxs/store/operators/append.ts","ng://@ngxs/store/operators/compose.ts","ng://@ngxs/store/operators/utils.ts","ng://@ngxs/store/operators/iif.ts","ng://@ngxs/store/operators/insert-item.ts","ng://@ngxs/store/operators/patch.ts","ng://@ngxs/store/operators/update-item.ts","ng://@ngxs/store/operators/remove-item.ts"],"sourcesContent":["import { StateOperator } from '@ngxs/store';\nimport { RepairType, NoInfer } from './utils';\n\n/**\n * @param items - Specific items to append to the end of an array\n */\nexport function append<T>(items: NoInfer<T>[]): StateOperator<RepairType<T>[]> {\n return function appendOperator(existing: Readonly<RepairType<T>[]>): RepairType<T>[] {\n // If `items` is `undefined` or `null` or `[]` but `existing` is provided\n // just return `existing`\n const itemsNotProvidedButExistingIs = (!items || !items.length) && existing;\n if (itemsNotProvidedButExistingIs) {\n return existing as RepairType<T>[];\n }\n\n if (Array.isArray(existing)) {\n return existing.concat((items as unknown) as RepairType<T>[]);\n }\n\n // For example if some property is added dynamically\n // and didn't exist before thus it's not `ArrayLike`\n return (items as unknown) as RepairType<T>[];\n };\n}\n","import { StateOperator } from '@ngxs/store';\nimport { NoInfer } from './utils';\n\nexport function compose<T>(...operators: NoInfer<StateOperator<T>[]>): StateOperator<T> {\n return function composeOperator(existing: Readonly<T>): T {\n return operators.reduce((accumulator, operator) => operator(accumulator), existing);\n };\n}\n","import { StateOperator } from '@ngxs/store';\n\nimport { Predicate } from './internals';\n\nexport function isStateOperator<T>(value: T | StateOperator<T>): value is StateOperator<T> {\n return typeof value === 'function';\n}\n\nexport function isUndefined(value: any): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isPredicate<T>(value: Predicate<T> | boolean | number): value is Predicate<T> {\n return typeof value === 'function';\n}\n\nexport function isNumber(value: any): value is number {\n return typeof value === 'number';\n}\n\nexport function invalidIndex(index: number): boolean {\n return Number.isNaN(index) || index === -1;\n}\n\nexport function isNil<T>(value: T | null | undefined): value is null | undefined {\n return value === null || isUndefined(value);\n}\n\nexport type RepairType<T> = T extends true ? boolean : T extends false ? boolean : T;\n\nexport type NoInfer<T> = T extends infer S ? S : never;\n","import { StateOperator } from '@ngxs/store';\n\nimport { isStateOperator, isUndefined, isPredicate, RepairType, NoInfer } from './utils';\nimport { Predicate } from './internals';\n\nfunction retrieveValue<T>(\n operatorOrValue: StateOperator<T> | T,\n existing?: Readonly<RepairType<T>>\n): RepairType<T> {\n // If state operator is a function\n // then call it with an original value\n if (isStateOperator(operatorOrValue)) {\n const value = operatorOrValue(existing! as Readonly<T>);\n return value as RepairType<T>;\n }\n\n // If operator or value was not provided\n // e.g. `elseOperatorOrValue` is `undefined`\n // then we just return an original value\n if (isUndefined(operatorOrValue)) {\n return (<any>existing)! as RepairType<T>;\n }\n\n return operatorOrValue as RepairType<T>;\n}\n\n/**\n * @param condition - Condition can be a plain boolean value or a function,\n * that returns boolean, also this function can take a value as an argument\n * to which this state operator applies\n * @param trueOperatorOrValue - Any value or a state operator\n * @param elseOperatorOrValue - Any value or a state operator\n */\nexport function iif<T>(\n condition: NoInfer<Predicate<T>> | boolean,\n trueOperatorOrValue: NoInfer<StateOperator<T>> | T,\n elseOperatorOrValue?: NoInfer<StateOperator<T>> | T\n): StateOperator<RepairType<T>> {\n return function iifOperator(existing: Readonly<RepairType<T>>): RepairType<T> {\n // Convert the value to a boolean\n let result = !!condition;\n // but if it is a function then run it to get the result\n if (isPredicate(condition)) {\n result = condition(existing);\n }\n\n if (result) {\n return retrieveValue<T>(trueOperatorOrValue, existing as RepairType<T>);\n }\n\n return retrieveValue<T>(elseOperatorOrValue!, existing as RepairType<T>);\n };\n}\n","import { StateOperator } from '@ngxs/store';\nimport { isNil, RepairType, NoInfer } from './utils';\n\n/**\n * @param value - Value to insert\n * @param [beforePosition] - Specified index to insert value before, optional\n */\nexport function insertItem<T>(\n value: NoInfer<T>,\n beforePosition?: number\n): StateOperator<RepairType<T>[]> {\n return function insertItemOperator(existing: Readonly<RepairType<T>[]>): RepairType<T>[] {\n // Have to check explicitly for `null` and `undefined`\n // because `value` can be `0`, thus `!value` will return `true`\n if (isNil(value) && existing) {\n return existing as RepairType<T>[];\n }\n\n // Property may be dynamic and might not existed before\n if (!Array.isArray(existing)) {\n return [(value as unknown) as RepairType<T>];\n }\n\n const clone = existing.slice();\n\n let index = 0;\n\n // No need to call `isNumber`\n // as we are checking `> 0` not `>= 0`\n // everything except number will return false here\n if (beforePosition! > 0) {\n index = beforePosition!;\n }\n\n clone.splice(index, 0, (value as unknown) as RepairType<T>);\n return clone;\n };\n}\n","import { StateOperator } from '@ngxs/store';\nimport { isStateOperator, NoInfer } from './utils';\n\nexport type PatchSpec<T> = { [P in keyof T]?: T[P] | StateOperator<NonNullable<T[P]>> };\n\ntype PatchValues<T> = {\n readonly [P in keyof T]?: T[P] extends (...args: any[]) => infer R ? R : T[P];\n};\n\nexport function patch<T>(patchObject: NoInfer<PatchSpec<T>>): StateOperator<NonNullable<T>> {\n return (function patchStateOperator(existing: Readonly<PatchValues<T>>): NonNullable<T> {\n let clone = null;\n for (const k in patchObject) {\n const newValue = patchObject[k];\n const existingPropValue = existing[k as Extract<keyof T, string>];\n const newPropValue = isStateOperator(newValue)\n ? newValue(<any>existingPropValue)\n : newValue;\n if (newPropValue !== existingPropValue) {\n if (!clone) {\n clone = { ...(<any>existing) };\n }\n clone[k] = newPropValue;\n }\n }\n return clone || existing;\n } as unknown) as StateOperator<NonNullable<T>>;\n}\n","import { StateOperator } from '@ngxs/store';\n\nimport {\n isStateOperator,\n isPredicate,\n isNumber,\n invalidIndex,\n RepairType,\n NoInfer\n} from './utils';\nimport { Predicate } from './internals';\n\n/**\n * @param selector - Index of item in the array or a predicate function\n * that can be provided in `Array.prototype.findIndex`\n * @param operatorOrValue - New value under the `selector` index or a\n * function that can be applied to an existing value\n */\nexport function updateItem<T>(\n selector: number | NoInfer<Predicate<T>>,\n operatorOrValue: NoInfer<T> | NoInfer<StateOperator<T>>\n): StateOperator<RepairType<T>[]> {\n return function updateItemOperator(existing: Readonly<RepairType<T>[]>): RepairType<T>[] {\n let index = -1;\n\n if (isPredicate(selector)) {\n index = existing.findIndex(selector as Predicate<T>);\n } else if (isNumber(selector)) {\n index = selector;\n }\n\n if (invalidIndex(index)) {\n return existing as RepairType<T>[];\n }\n\n let value: T = null!;\n // Need to check if the new item value will change the existing item value\n // then, only if it will change it then clone the array and set the item\n const theOperatorOrValue = operatorOrValue as T | StateOperator<T>;\n if (isStateOperator(theOperatorOrValue)) {\n value = theOperatorOrValue(existing[index] as Readonly<T>);\n } else {\n value = theOperatorOrValue;\n }\n\n // If the value hasn't been mutated\n // then we just return `existing` array\n if (value === existing[index]) {\n return existing as RepairType<T>[];\n }\n\n const clone = existing.slice();\n clone[index] = value as RepairType<T>;\n return clone;\n };\n}\n","import { StateOperator } from '@ngxs/store';\nimport { Predicate } from './internals';\nimport { isPredicate, isNumber, invalidIndex, RepairType } from './utils';\n\n/**\n * @param selector - index or predicate to remove an item from an array by\n */\nexport function removeItem<T>(\n selector: number | Predicate<T>\n): StateOperator<RepairType<T>[]> {\n return function removeItemOperator(existing: Readonly<RepairType<T>[]>): RepairType<T>[] {\n let index = -1;\n\n if (isPredicate(selector)) {\n index = existing.findIndex(selector);\n } else if (isNumber(selector)) {\n index = selector;\n }\n\n if (invalidIndex(index)) {\n return existing as RepairType<T>[];\n }\n\n const clone = existing.slice();\n clone.splice(index, 1);\n return clone;\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAMA,SAAgB,MAAM,CAAI,KAAmB;IAC3C;;;;IAAO,SAAS,cAAc,CAAC,QAAmC;;;;YAG1D,6BAA6B,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,QAAQ;QAC3E,IAAI,6BAA6B,EAAE;YACjC,0BAAO,QAAQ,GAAoB;SACpC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC3B,OAAO,QAAQ,CAAC,MAAM,wCAAE,KAAK,MAAgC,CAAC;SAC/D;;;QAID,8CAAQ,KAAK,MAAgC;KAC9C,EAAC;CACH;;;;;;;;;;;ACpBD,SAAgB,OAAO;IAAI,mBAAyC;SAAzC,UAAyC,EAAzC,qBAAyC,EAAzC,IAAyC;QAAzC,8BAAyC;;IAClE;;;;IAAO,SAAS,eAAe,CAAC,QAAqB;QACnD,OAAO,SAAS,CAAC,MAAM;;;;;QAAC,UAAC,WAAW,EAAE,QAAQ,IAAK,OAAA,QAAQ,CAAC,WAAW,CAAC,GAAA,GAAE,QAAQ,CAAC,CAAC;KACrF,EAAC;CACH;;;;;;;;;;;ACHD,SAAgB,eAAe,CAAI,KAA2B;IAC5D,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;C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QAAQ,CAAC,KAAK,EAAE;QAC9B,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;KACd,EAAC;CACH;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ngxs-store-operators.js","sources":["ng://@ngxs/store/operators/append.ts","ng://@ngxs/store/operators/compose.ts","ng://@ngxs/store/operators/utils.ts","ng://@ngxs/store/operators/iif.ts","ng://@ngxs/store/operators/insert-item.ts","ng://@ngxs/store/operators/patch.ts","ng://@ngxs/store/operators/update-item.ts","ng://@ngxs/store/operators/remove-item.ts"],"sourcesContent":["import { ExistingState, NoInfer, StateOperator } from './types';\n\n/**\n * @param items - Specific items to append to the end of an array\n */\nexport function append<T>(items: NoInfer<T[]>): StateOperator<T[]> {\n return function appendOperator(existing: ExistingState<T[]>): T[] {\n // If `items` is `undefined` or `null` or `[]` but `existing` is provided\n // just return `existing`\n const itemsNotProvidedButExistingIs = (!items || !items.length) && existing;\n if (itemsNotProvidedButExistingIs) {\n return (existing as unknown) as T[];\n }\n\n if (Array.isArray(existing)) {\n return existing.concat((items as unknown) as ExistingState<T[]>);\n }\n\n // For example if some property is added dynamically\n // and didn't exist before thus it's not `ArrayLike`\n return (items as unknown) as T[];\n };\n}\n","import { ExistingState, NoInfer, StateOperator } from './types';\n\nexport function compose<T>(...operators: NoInfer<StateOperator<T>[]>): StateOperator<T> {\n return function composeOperator(existing: ExistingState<T>): T {\n return operators.reduce(\n (accumulator, operator) => operator(accumulator as ExistingState<T>),\n existing as T\n );\n };\n}\n","import { StateOperator } from './types';\n\nexport type Predicate<T = any> = (value: T | Readonly<T>) => boolean;\n\nexport function isStateOperator<T>(value: T | StateOperator<T>): value is StateOperator<T> {\n return typeof value === 'function';\n}\n\nexport function isUndefined(value: any): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isPredicate<T>(value: Predicate<T> | boolean | number): value is Predicate<T> {\n return typeof value === 'function';\n}\n\nexport function isNumber(value: any): value is number {\n return typeof value === 'number';\n}\n\nexport function invalidIndex(index: number): boolean {\n return Number.isNaN(index) || index === -1;\n}\n\nexport function isNil<T>(value: T | null | undefined): value is null | undefined {\n return value === null || isUndefined(value);\n}\n","import { ExistingState, NoInfer, StateOperator } from './types';\n\nimport { isStateOperator, isUndefined, isPredicate, Predicate } from './utils';\n\nfunction retrieveValue<T>(\n operatorOrValue: StateOperator<T> | T,\n existing: ExistingState<T>\n): T {\n // If state operator is a function\n // then call it with an original value\n if (isStateOperator(operatorOrValue)) {\n const value = operatorOrValue(existing);\n return value as T;\n }\n\n // If operator or value was not provided\n // e.g. `elseOperatorOrValue` is `undefined`\n // then we just return an original value\n if (isUndefined(operatorOrValue)) {\n return existing as T;\n }\n\n return operatorOrValue as T;\n}\n\n/**\n * @param condition - Condition can be a plain boolean value or a function,\n * that returns boolean, also this function can take a value as an argument\n * to which this state operator applies\n * @param trueOperatorOrValue - Any value or a state operator\n * @param elseOperatorOrValue - Any value or a state operator\n */\nexport function iif<T>(\n condition: NoInfer<Predicate<T>> | boolean,\n trueOperatorOrValue: NoInfer<StateOperator<T> | T>,\n elseOperatorOrValue?: NoInfer<StateOperator<T> | T>\n): StateOperator<T> {\n return function iifOperator(existing: ExistingState<T>): T {\n // Convert the value to a boolean\n let result = !!condition;\n // but if it is a function then run it to get the result\n if (isPredicate(condition)) {\n result = condition(existing as T);\n }\n\n if (result) {\n return retrieveValue<T>(trueOperatorOrValue as StateOperator<T> | T, existing);\n }\n\n return retrieveValue<T>(elseOperatorOrValue! as StateOperator<T> | T, existing);\n };\n}\n","import { ExistingState, NoInfer, StateOperator } from './types';\nimport { isNil } from './utils';\n\n/**\n * @param value - Value to insert\n * @param [beforePosition] - Specified index to insert value before, optional\n */\nexport function insertItem<T>(value: NoInfer<T>, beforePosition?: number): StateOperator<T[]> {\n return function insertItemOperator(existing: ExistingState<T[]>): T[] {\n // Have to check explicitly for `null` and `undefined`\n // because `value` can be `0`, thus `!value` will return `true`\n if (isNil(value) && existing) {\n return existing as T[];\n }\n\n // Property may be dynamic and might not existed before\n if (!Array.isArray(existing)) {\n return [(value as unknown) as T];\n }\n\n const clone = existing.slice();\n\n let index = 0;\n\n // No need to call `isNumber`\n // as we are checking `> 0` not `>= 0`\n // everything except number will return false here\n if (beforePosition! > 0) {\n index = beforePosition!;\n }\n\n clone.splice(index, 0, (value as unknown) as T);\n return clone;\n };\n}\n","import { ExistingState, NoInfer, StateOperator } from './types';\nimport { isStateOperator } from './utils';\n\ntype NotUndefined<T> = T extends undefined ? never : T;\n\nexport type PatchSpec<T> = { [P in keyof T]?: T[P] | StateOperator<NotUndefined<T[P]>> };\n\nexport function patch<T extends Record<string, any>>(\n patchObject: NoInfer<PatchSpec<T>>\n): StateOperator<T> {\n return function patchStateOperator(existing: ExistingState<T>): T {\n let clone = null;\n for (const k in patchObject) {\n const newValue = patchObject[k];\n const existingPropValue = existing[k];\n const newPropValue = isStateOperator(newValue)\n ? newValue(<any>existingPropValue)\n : newValue;\n if (newPropValue !== existingPropValue) {\n if (!clone) {\n clone = { ...(<any>existing) };\n }\n clone[k] = newPropValue;\n }\n }\n return clone || existing;\n };\n}\n","import { ExistingState, NoInfer, StateOperator } from './types';\n\nimport { isStateOperator, isPredicate, isNumber, invalidIndex, Predicate } from './utils';\n\n/**\n * @param selector - Index of item in the array or a predicate function\n * that can be provided in `Array.prototype.findIndex`\n * @param operatorOrValue - New value under the `selector` index or a\n * function that can be applied to an existing value\n */\nexport function updateItem<T>(\n selector: number | NoInfer<Predicate<T>>,\n operatorOrValue: NoInfer<T> | NoInfer<StateOperator<T>>\n): StateOperator<T[]> {\n return function updateItemOperator(existing: ExistingState<T[]>): T[] {\n let index = -1;\n\n if (isPredicate(selector)) {\n index = existing.findIndex(selector as Predicate<T>);\n } else if (isNumber(selector)) {\n index = selector;\n }\n\n if (invalidIndex(index)) {\n return existing as T[];\n }\n\n let value: T = null!;\n // Need to check if the new item value will change the existing item value\n // then, only if it will change it then clone the array and set the item\n const theOperatorOrValue = operatorOrValue as T | StateOperator<T>;\n if (isStateOperator(theOperatorOrValue)) {\n value = theOperatorOrValue(existing[index] as ExistingState<T>);\n } else {\n value = theOperatorOrValue;\n }\n\n // If the value hasn't been mutated\n // then we just return `existing` array\n if (value === existing[index]) {\n return existing as T[];\n }\n\n const clone = existing.slice();\n clone[index] = value as T;\n return clone;\n };\n}\n","import { ExistingState, NoInfer, StateOperator } from './types';\nimport { isPredicate, isNumber, invalidIndex, Predicate } from './utils';\n\n/**\n * @param selector - index or predicate to remove an item from an array by\n */\nexport function removeItem<T>(selector: number | NoInfer<Predicate<T>>): StateOperator<T[]> {\n return function removeItemOperator(existing: ExistingState<T[]>): T[] {\n let index = -1;\n\n if (isPredicate(selector)) {\n index = existing.findIndex(selector);\n } else if (isNumber(selector)) {\n index = selector;\n }\n\n if (invalidIndex(index)) {\n return existing as T[];\n }\n\n const clone = existing.slice();\n clone.splice(index, 1);\n return clone;\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAKA,SAAgB,MAAM,CAAI,KAAmB;IAC3C;;;;IAAO,SAAS,cAAc,CAAC,QAA4B;;;;YAGnD,6BAA6B,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,QAAQ;QAC3E,IAAI,6BAA6B,EAAE;YACjC,8CAAQ,QAAQ,MAAoB;SACrC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC3B,OAAO,QAAQ,CAAC,MAAM,wCAAE,KAAK,MAAmC,CAAC;SAClE;;;QAID,8CAAQ,KAAK,MAAoB;KAClC,EAAC;CACH;;;;;;;;;;;ACpBD,SAAgB,OAAO;IAAI,mBAAyC;SAAzC,UAAyC,EAAzC,qBAAyC,EAAzC,IAAyC;QAAzC,8BAAyC;;IAClE;;;;IAAO,SAAS,eAAe,CAAC,QAA0B;QACxD,OAAO,SAAS,CAAC,MAAM;;;;;QACrB,UAAC,WAAW,EAAE,QAAQ,IAAK,OA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AAC,EAAE;YAC7B,KAAK,GAAG,QAAQ,CAAC;SAClB;QAED,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;YACvB,0BAAO,QAAQ,GAAQ;SACxB;;YAEK,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE;QAC9B,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;KACd,EAAC;CACH;;;;;;;;;;;;;;"}
@@ -2395,7 +2395,7 @@ var StateContextFactory = /** @class */ (function () {
2395
2395
  /** @type {?} */
2396
2396
  var local = getState(currentAppState);
2397
2397
  /** @type {?} */
2398
- var newValue = stateOperator(local);
2398
+ var newValue = stateOperator((/** @type {?} */ (local)));
2399
2399
  return setStateValue(currentAppState, newValue);
2400
2400
  }
2401
2401
  /**
@@ -2563,6 +2563,175 @@ function ensureStateClassIsInjectable(stateClass) {
2563
2563
  }
2564
2564
  }
2565
2565
 
2566
+ /**
2567
+ * @fileoverview added by tsickle
2568
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2569
+ */
2570
+ /**
2571
+ * Init action
2572
+ */
2573
+ var /**
2574
+ * Init action
2575
+ */
2576
+ InitState = /** @class */ (function () {
2577
+ function InitState() {
2578
+ }
2579
+ Object.defineProperty(InitState, "type", {
2580
+ get: /**
2581
+ * @return {?}
2582
+ */
2583
+ function () {
2584
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
2585
+ return '@@INIT';
2586
+ },
2587
+ enumerable: true,
2588
+ configurable: true
2589
+ });
2590
+ return InitState;
2591
+ }());
2592
+ /**
2593
+ * Update action
2594
+ */
2595
+ var /**
2596
+ * Update action
2597
+ */
2598
+ UpdateState = /** @class */ (function () {
2599
+ function UpdateState(addedStates) {
2600
+ this.addedStates = addedStates;
2601
+ }
2602
+ Object.defineProperty(UpdateState, "type", {
2603
+ get: /**
2604
+ * @return {?}
2605
+ */
2606
+ function () {
2607
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
2608
+ return '@@UPDATE_STATE';
2609
+ },
2610
+ enumerable: true,
2611
+ configurable: true
2612
+ });
2613
+ return UpdateState;
2614
+ }());
2615
+ if (false) {
2616
+ /** @type {?} */
2617
+ UpdateState.prototype.addedStates;
2618
+ }
2619
+
2620
+ /**
2621
+ * @fileoverview added by tsickle
2622
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2623
+ */
2624
+ /**
2625
+ * @record
2626
+ */
2627
+ function NgxsDevelopmentOptions() { }
2628
+ if (false) {
2629
+ /** @type {?} */
2630
+ NgxsDevelopmentOptions.prototype.warnOnUnhandledActions;
2631
+ }
2632
+ /** @type {?} */
2633
+ var NGXS_DEVELOPMENT_OPTIONS = new InjectionToken('NGXS_DEVELOPMENT_OPTIONS', {
2634
+ providedIn: 'root',
2635
+ factory: (/**
2636
+ * @return {?}
2637
+ */
2638
+ function () { return ({
2639
+ warnOnUnhandledActions: { ignore: [] }
2640
+ }); })
2641
+ });
2642
+
2643
+ /**
2644
+ * @fileoverview added by tsickle
2645
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2646
+ */
2647
+ var NgxsUnhandledActionsLogger = /** @class */ (function () {
2648
+ function NgxsUnhandledActionsLogger(options) {
2649
+ /**
2650
+ * These actions should be ignored by default; the user can increase this
2651
+ * list in the future via the `ignoreActions` method.
2652
+ */
2653
+ this._ignoredActions = new Set([InitState.type, UpdateState.type]);
2654
+ this.ignoreActions.apply(this, __spread(options.warnOnUnhandledActions.ignore));
2655
+ }
2656
+ /**
2657
+ * Adds actions to the internal list of actions that should be ignored.
2658
+ */
2659
+ /**
2660
+ * Adds actions to the internal list of actions that should be ignored.
2661
+ * @param {...?} actions
2662
+ * @return {?}
2663
+ */
2664
+ NgxsUnhandledActionsLogger.prototype.ignoreActions = /**
2665
+ * Adds actions to the internal list of actions that should be ignored.
2666
+ * @param {...?} actions
2667
+ * @return {?}
2668
+ */
2669
+ function () {
2670
+ var actions = [];
2671
+ for (var _i = 0; _i < arguments.length; _i++) {
2672
+ actions[_i] = arguments[_i];
2673
+ }
2674
+ var e_1, _a;
2675
+ try {
2676
+ for (var actions_1 = __values(actions), actions_1_1 = actions_1.next(); !actions_1_1.done; actions_1_1 = actions_1.next()) {
2677
+ var action = actions_1_1.value;
2678
+ this._ignoredActions.add(action.type);
2679
+ }
2680
+ }
2681
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2682
+ finally {
2683
+ try {
2684
+ if (actions_1_1 && !actions_1_1.done && (_a = actions_1.return)) _a.call(actions_1);
2685
+ }
2686
+ finally { if (e_1) throw e_1.error; }
2687
+ }
2688
+ };
2689
+ /** @internal */
2690
+ /**
2691
+ * \@internal
2692
+ * @param {?} action
2693
+ * @return {?}
2694
+ */
2695
+ NgxsUnhandledActionsLogger.prototype.warn = /**
2696
+ * \@internal
2697
+ * @param {?} action
2698
+ * @return {?}
2699
+ */
2700
+ function (action) {
2701
+ /** @type {?} */
2702
+ var actionShouldBeIgnored = Array.from(this._ignoredActions).some((/**
2703
+ * @param {?} type
2704
+ * @return {?}
2705
+ */
2706
+ function (type) { return type === getActionTypeFromInstance(action); }));
2707
+ if (actionShouldBeIgnored) {
2708
+ return;
2709
+ }
2710
+ action =
2711
+ action.constructor && action.constructor.name !== 'Object'
2712
+ ? action.constructor.name
2713
+ : action.type;
2714
+ console.warn("The " + action + " action has been dispatched but hasn't been handled. This may happen if the state with an action handler for this action is not registered.");
2715
+ };
2716
+ NgxsUnhandledActionsLogger.decorators = [
2717
+ { type: Injectable }
2718
+ ];
2719
+ /** @nocollapse */
2720
+ NgxsUnhandledActionsLogger.ctorParameters = function () { return [
2721
+ { type: undefined, decorators: [{ type: Inject, args: [NGXS_DEVELOPMENT_OPTIONS,] }] }
2722
+ ]; };
2723
+ return NgxsUnhandledActionsLogger;
2724
+ }());
2725
+ if (false) {
2726
+ /**
2727
+ * These actions should be ignored by default; the user can increase this
2728
+ * list in the future via the `ignoreActions` method.
2729
+ * @type {?}
2730
+ * @private
2731
+ */
2732
+ NgxsUnhandledActionsLogger.prototype._ignoredActions;
2733
+ }
2734
+
2566
2735
  /**
2567
2736
  * @fileoverview added by tsickle
2568
2737
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -2708,10 +2877,8 @@ var StateFactory = /** @class */ (function () {
2708
2877
  * @return {?}
2709
2878
  */
2710
2879
  function () {
2711
- // I'm using non-null assertion here since `_actionsSubscrition` will
2712
- // be 100% defined. This is because `ngOnDestroy()` cannot be invoked
2713
- // on the `StateFactory` until its initialized :) An it's initialized
2714
- // for the first time along with the `NgxsRootModule`.
2880
+ // This is being non-null asserted since `_actionsSubscrition` is
2881
+ // initialized within the constructor.
2715
2882
  (/** @type {?} */ (this._actionsSubscription)).unsubscribe();
2716
2883
  };
2717
2884
  /**
@@ -2888,6 +3055,10 @@ var StateFactory = /** @class */ (function () {
2888
3055
  var type = (/** @type {?} */ (getActionTypeFromInstance(action)));
2889
3056
  /** @type {?} */
2890
3057
  var results = [];
3058
+ // Determines whether the dispatched action has been handled, this is assigned
3059
+ // to `true` within the below `for` loop if any `actionMetas` has been found.
3060
+ /** @type {?} */
3061
+ var actionHasBeenHandled = false;
2891
3062
  try {
2892
3063
  for (var _c = __values(this.states), _d = _c.next(); !_d.done; _d = _c.next()) {
2893
3064
  var metadata = _d.value;
@@ -2940,6 +3111,7 @@ var StateFactory = /** @class */ (function () {
2940
3111
  catch (e) {
2941
3112
  results.push(throwError(e));
2942
3113
  }
3114
+ actionHasBeenHandled = true;
2943
3115
  }
2944
3116
  }
2945
3117
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
@@ -2959,6 +3131,18 @@ var StateFactory = /** @class */ (function () {
2959
3131
  }
2960
3132
  finally { if (e_2) throw e_2.error; }
2961
3133
  }
3134
+ // The `NgxsUnhandledActionsLogger` is a tree-shakable class which functions
3135
+ // only during development.
3136
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !actionHasBeenHandled) {
3137
+ /** @type {?} */
3138
+ var unhandledActionsLogger = this._injector.get(NgxsUnhandledActionsLogger, null);
3139
+ // The `NgxsUnhandledActionsLogger` will not be resolved by the injector if the
3140
+ // `NgxsDevelopmentModule` is not provided. It's enough to check whether the `injector.get`
3141
+ // didn't return `null` so we may ensure the module has been imported.
3142
+ if (unhandledActionsLogger) {
3143
+ unhandledActionsLogger.warn(action);
3144
+ }
3145
+ }
2962
3146
  if (!results.length) {
2963
3147
  results.push(of({}));
2964
3148
  }
@@ -3839,60 +4023,6 @@ if (false) {
3839
4023
  SelectFactory.config;
3840
4024
  }
3841
4025
 
3842
- /**
3843
- * @fileoverview added by tsickle
3844
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3845
- */
3846
- /**
3847
- * Init action
3848
- */
3849
- var /**
3850
- * Init action
3851
- */
3852
- InitState = /** @class */ (function () {
3853
- function InitState() {
3854
- }
3855
- Object.defineProperty(InitState, "type", {
3856
- get: /**
3857
- * @return {?}
3858
- */
3859
- function () {
3860
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
3861
- return '@@INIT';
3862
- },
3863
- enumerable: true,
3864
- configurable: true
3865
- });
3866
- return InitState;
3867
- }());
3868
- /**
3869
- * Update action
3870
- */
3871
- var /**
3872
- * Update action
3873
- */
3874
- UpdateState = /** @class */ (function () {
3875
- function UpdateState(addedStates) {
3876
- this.addedStates = addedStates;
3877
- }
3878
- Object.defineProperty(UpdateState, "type", {
3879
- get: /**
3880
- * @return {?}
3881
- */
3882
- function () {
3883
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
3884
- return '@@UPDATE_STATE';
3885
- },
3886
- enumerable: true,
3887
- configurable: true
3888
- });
3889
- return UpdateState;
3890
- }());
3891
- if (false) {
3892
- /** @type {?} */
3893
- UpdateState.prototype.addedStates;
3894
- }
3895
-
3896
4026
  /**
3897
4027
  * @fileoverview added by tsickle
3898
4028
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -4599,6 +4729,36 @@ if (false) {
4599
4729
  StateToken.prototype.name;
4600
4730
  }
4601
4731
 
4732
+ /**
4733
+ * @fileoverview added by tsickle
4734
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4735
+ */
4736
+ var NgxsDevelopmentModule = /** @class */ (function () {
4737
+ function NgxsDevelopmentModule() {
4738
+ }
4739
+ /**
4740
+ * @param {?} options
4741
+ * @return {?}
4742
+ */
4743
+ NgxsDevelopmentModule.forRoot = /**
4744
+ * @param {?} options
4745
+ * @return {?}
4746
+ */
4747
+ function (options) {
4748
+ return {
4749
+ ngModule: NgxsDevelopmentModule,
4750
+ providers: [
4751
+ NgxsUnhandledActionsLogger,
4752
+ { provide: NGXS_DEVELOPMENT_OPTIONS, useValue: options }
4753
+ ]
4754
+ };
4755
+ };
4756
+ NgxsDevelopmentModule.decorators = [
4757
+ { type: NgModule }
4758
+ ];
4759
+ return NgxsDevelopmentModule;
4760
+ }());
4761
+
4602
4762
  /**
4603
4763
  * @fileoverview added by tsickle
4604
4764
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -4619,5 +4779,5 @@ if (false) {
4619
4779
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4620
4780
  */
4621
4781
 
4622
- export { Action, Actions, InitState, NGXS_PLUGINS, NgxsModule, NgxsSimpleChange, NoopNgxsExecutionStrategy, Select, Selector, SelectorOptions, State, StateStream, StateToken, Store, UpdateState, actionMatcher, createSelector, ensureSelectorMetadata$1 as ensureSelectorMetadata, ensureStoreMetadata$1 as ensureStoreMetadata, getActionTypeFromInstance, getSelectorMetadata$1 as getSelectorMetadata, getStoreMetadata$1 as getStoreMetadata, getValue, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, setValue, OrderedSubject as ɵa, InternalActions as ɵb, ROOT_STATE_TOKEN as ɵc, FEATURE_STATE_TOKEN as ɵd, SELECTOR_META_KEY as ɵe, NgxsConfig as ɵf, mergeDeep as ɵg, USER_PROVIDED_NGXS_EXECUTION_STRATEGY as ɵh, NGXS_EXECUTION_STRATEGY as ɵi, NgxsRootModule as ɵj, StateFactory as ɵk, InternalDispatchedActionResults as ɵl, InternalDispatcher as ɵm, StateContextFactory as ɵn, InternalStateOperations as ɵo, PluginManager as ɵp, InternalNgxsExecutionStrategy as ɵq, InternalErrorReporter as ɵr, SelectFactory as ɵs, ensureStoreMetadata as ɵu, getStoreMetadata as ɵv, ensureSelectorMetadata as ɵw, getSelectorMetadata as ɵx, LifecycleStateManager as ɵy, NgxsFeatureModule as ɵz };
4782
+ export { Action, Actions, InitState, NGXS_PLUGINS, NgxsDevelopmentModule, NgxsModule, NgxsSimpleChange, NgxsUnhandledActionsLogger, NoopNgxsExecutionStrategy, Select, Selector, SelectorOptions, State, StateStream, StateToken, Store, UpdateState, actionMatcher, createSelector, ensureSelectorMetadata$1 as ensureSelectorMetadata, ensureStoreMetadata$1 as ensureStoreMetadata, getActionTypeFromInstance, getSelectorMetadata$1 as getSelectorMetadata, getStoreMetadata$1 as getStoreMetadata, getValue, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, setValue, OrderedSubject as ɵa, InternalActions as ɵb, NgxsFeatureModule as ɵba, ROOT_STATE_TOKEN as ɵc, FEATURE_STATE_TOKEN as ɵd, SELECTOR_META_KEY as ɵe, NgxsConfig as ɵf, mergeDeep as ɵg, USER_PROVIDED_NGXS_EXECUTION_STRATEGY as ɵh, NGXS_EXECUTION_STRATEGY as ɵi, NGXS_DEVELOPMENT_OPTIONS as ɵj, NgxsRootModule as ɵk, StateFactory as ɵl, InternalDispatchedActionResults as ɵm, InternalDispatcher as ɵn, StateContextFactory as ɵo, InternalStateOperations as ɵp, PluginManager as ɵq, InternalNgxsExecutionStrategy as ɵr, InternalErrorReporter as ɵs, SelectFactory as ɵt, ensureStoreMetadata as ɵv, getStoreMetadata as ɵw, ensureSelectorMetadata as ɵx, getSelectorMetadata as ɵy, LifecycleStateManager as ɵz };
4623
4783
  //# sourceMappingURL=ngxs-store.js.map