@ngxs/store 3.7.2-dev.master-9a7c431 → 3.7.2

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 (266) hide show
  1. package/README.md +16 -16
  2. package/bundles/ngxs-store-internals.umd.js +211 -380
  3. package/bundles/ngxs-store-internals.umd.js.map +1 -1
  4. package/bundles/ngxs-store-internals.umd.min.js +1 -1
  5. package/bundles/ngxs-store-internals.umd.min.js.map +1 -1
  6. package/bundles/ngxs-store-operators.umd.js +310 -310
  7. package/bundles/ngxs-store-operators.umd.js.map +1 -1
  8. package/bundles/ngxs-store-operators.umd.min.js.map +1 -1
  9. package/bundles/ngxs-store.umd.js +4518 -4402
  10. package/bundles/ngxs-store.umd.js.map +1 -1
  11. package/bundles/ngxs-store.umd.min.js +1 -1
  12. package/bundles/ngxs-store.umd.min.js.map +1 -1
  13. package/esm2015/index.js +13 -13
  14. package/esm2015/internals/angular.js +40 -46
  15. package/esm2015/internals/index.js +10 -11
  16. package/esm2015/internals/initial-state.js +34 -34
  17. package/esm2015/internals/internal-tokens.js +16 -16
  18. package/esm2015/internals/memoize.js +70 -70
  19. package/esm2015/internals/ngxs-bootstrapper.js +41 -41
  20. package/esm2015/internals/ngxs-store-internals.js +9 -9
  21. package/esm2015/internals/src/symbols.js +14 -14
  22. package/esm2015/internals/symbols.js +14 -14
  23. package/esm2015/ngxs-store.js +27 -24
  24. package/esm2015/operators/append.js +31 -31
  25. package/esm2015/operators/compose.js +24 -24
  26. package/esm2015/operators/iif.js +56 -56
  27. package/esm2015/operators/index.js +18 -18
  28. package/esm2015/operators/insert-item.js +41 -41
  29. package/esm2015/operators/internals.js +5 -5
  30. package/esm2015/operators/ngxs-store-operators.js +8 -8
  31. package/esm2015/operators/patch.js +39 -39
  32. package/esm2015/operators/remove-item.js +34 -34
  33. package/esm2015/operators/update-item.js +52 -52
  34. package/esm2015/operators/utils.js +50 -50
  35. package/esm2015/src/actions/actions.js +39 -39
  36. package/esm2015/src/actions/symbols.js +39 -39
  37. package/esm2015/src/actions-stream.js +140 -138
  38. package/esm2015/src/configs/messages.config.js +87 -79
  39. package/esm2015/src/decorators/action.js +44 -48
  40. package/esm2015/src/decorators/select/select-factory.js +46 -49
  41. package/esm2015/src/decorators/select/select.js +45 -60
  42. package/esm2015/src/decorators/select/symbols.js +50 -94
  43. package/esm2015/src/decorators/selector/selector.js +55 -59
  44. package/esm2015/src/decorators/selector/symbols.js +5 -5
  45. package/esm2015/src/decorators/selector-options.js +34 -34
  46. package/esm2015/src/decorators/state.js +75 -83
  47. package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +96 -101
  48. package/esm2015/src/execution/internal-ngxs-execution-strategy.js +45 -45
  49. package/esm2015/src/execution/noop-ngxs-execution-strategy.js +27 -27
  50. package/esm2015/src/execution/symbols.js +29 -29
  51. package/esm2015/src/host-environment/host-environment.js +31 -0
  52. package/esm2015/src/internal/config-validator.js +67 -0
  53. package/esm2015/src/internal/dispatcher.js +217 -217
  54. package/esm2015/src/internal/internals.js +489 -493
  55. package/esm2015/src/internal/lifecycle-state-manager.js +129 -129
  56. package/esm2015/src/internal/state-context-factory.js +138 -138
  57. package/esm2015/src/internal/state-factory.js +429 -449
  58. package/esm2015/src/internal/state-operations.js +125 -120
  59. package/esm2015/src/internal/state-operators.js +33 -33
  60. package/esm2015/src/internal/state-stream.js +21 -21
  61. package/esm2015/src/ivy/ensure-state-class-is-injectable.js +34 -0
  62. package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +40 -28
  63. package/esm2015/src/module.js +172 -158
  64. package/esm2015/src/modules/ngxs-feature.module.js +63 -63
  65. package/esm2015/src/modules/ngxs-root.module.js +52 -52
  66. package/esm2015/src/operators/leave-ngxs.js +58 -58
  67. package/esm2015/src/operators/of-action.js +191 -191
  68. package/esm2015/src/plugin-manager.js +70 -70
  69. package/esm2015/src/plugin_api.js +10 -10
  70. package/esm2015/src/public_api.js +29 -29
  71. package/esm2015/src/public_to_deprecate.js +64 -64
  72. package/esm2015/src/state-token/state-token.js +45 -45
  73. package/esm2015/src/state-token/symbols.js +5 -5
  74. package/esm2015/src/store.js +174 -174
  75. package/esm2015/src/symbols.js +221 -217
  76. package/esm2015/src/utils/compose.js +44 -44
  77. package/esm2015/src/utils/freeze.js +35 -35
  78. package/esm2015/src/utils/selector-utils.js +221 -221
  79. package/esm2015/src/utils/store-validators.js +65 -60
  80. package/esm2015/src/utils/utils.js +143 -143
  81. package/esm5/index.js +13 -13
  82. package/esm5/internals/angular.js +40 -46
  83. package/esm5/internals/index.js +10 -11
  84. package/esm5/internals/initial-state.js +45 -45
  85. package/esm5/internals/internal-tokens.js +16 -16
  86. package/esm5/internals/memoize.js +71 -71
  87. package/esm5/internals/ngxs-bootstrapper.js +56 -56
  88. package/esm5/internals/ngxs-store-internals.js +9 -9
  89. package/esm5/internals/src/symbols.js +14 -14
  90. package/esm5/internals/symbols.js +14 -14
  91. package/esm5/ngxs-store.js +27 -24
  92. package/esm5/operators/append.js +31 -31
  93. package/esm5/operators/compose.js +28 -28
  94. package/esm5/operators/iif.js +56 -56
  95. package/esm5/operators/index.js +18 -18
  96. package/esm5/operators/insert-item.js +41 -41
  97. package/esm5/operators/internals.js +5 -5
  98. package/esm5/operators/ngxs-store-operators.js +8 -8
  99. package/esm5/operators/patch.js +40 -40
  100. package/esm5/operators/remove-item.js +34 -34
  101. package/esm5/operators/update-item.js +52 -52
  102. package/esm5/operators/utils.js +50 -50
  103. package/esm5/src/actions/actions.js +62 -62
  104. package/esm5/src/actions/symbols.js +39 -39
  105. package/esm5/src/actions-stream.js +186 -184
  106. package/esm5/src/configs/messages.config.js +104 -79
  107. package/esm5/src/decorators/action.js +56 -60
  108. package/esm5/src/decorators/select/select-factory.js +47 -50
  109. package/esm5/src/decorators/select/select.js +50 -65
  110. package/esm5/src/decorators/select/symbols.js +51 -95
  111. package/esm5/src/decorators/selector/selector.js +55 -59
  112. package/esm5/src/decorators/selector/symbols.js +5 -5
  113. package/esm5/src/decorators/selector-options.js +34 -34
  114. package/esm5/src/decorators/state.js +76 -84
  115. package/esm5/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +121 -121
  116. package/esm5/src/execution/internal-ngxs-execution-strategy.js +54 -54
  117. package/esm5/src/execution/noop-ngxs-execution-strategy.js +41 -41
  118. package/esm5/src/execution/symbols.js +29 -29
  119. package/esm5/src/host-environment/host-environment.js +29 -0
  120. package/esm5/src/internal/config-validator.js +76 -0
  121. package/esm5/src/internal/dispatcher.js +253 -253
  122. package/esm5/src/internal/internals.js +491 -495
  123. package/esm5/src/internal/lifecycle-state-manager.js +177 -177
  124. package/esm5/src/internal/state-context-factory.js +146 -146
  125. package/esm5/src/internal/state-factory.js +563 -575
  126. package/esm5/src/internal/state-operations.js +139 -130
  127. package/esm5/src/internal/state-operators.js +34 -34
  128. package/esm5/src/internal/state-stream.js +25 -25
  129. package/esm5/src/ivy/ensure-state-class-is-injectable.js +34 -0
  130. package/esm5/src/ivy/ivy-enabled-in-dev-mode.js +40 -28
  131. package/esm5/src/module.js +215 -201
  132. package/esm5/src/modules/ngxs-feature.module.js +65 -65
  133. package/esm5/src/modules/ngxs-root.module.js +47 -47
  134. package/esm5/src/operators/leave-ngxs.js +58 -58
  135. package/esm5/src/operators/of-action.js +217 -217
  136. package/esm5/src/plugin-manager.js +82 -82
  137. package/esm5/src/plugin_api.js +10 -10
  138. package/esm5/src/public_api.js +29 -29
  139. package/esm5/src/public_to_deprecate.js +64 -64
  140. package/esm5/src/state-token/state-token.js +57 -57
  141. package/esm5/src/state-token/symbols.js +5 -5
  142. package/esm5/src/store.js +225 -225
  143. package/esm5/src/symbols.js +230 -226
  144. package/esm5/src/utils/compose.js +55 -55
  145. package/esm5/src/utils/freeze.js +35 -35
  146. package/esm5/src/utils/selector-utils.js +230 -230
  147. package/esm5/src/utils/store-validators.js +86 -78
  148. package/esm5/src/utils/utils.js +151 -151
  149. package/fesm2015/ngxs-store-internals.js +194 -361
  150. package/fesm2015/ngxs-store-internals.js.map +1 -1
  151. package/fesm2015/ngxs-store-operators.js +312 -312
  152. package/fesm2015/ngxs-store-operators.js.map +1 -1
  153. package/fesm2015/ngxs-store.js +3976 -3907
  154. package/fesm2015/ngxs-store.js.map +1 -1
  155. package/fesm5/ngxs-store-internals.js +219 -386
  156. package/fesm5/ngxs-store-internals.js.map +1 -1
  157. package/fesm5/ngxs-store-operators.js +316 -316
  158. package/fesm5/ngxs-store-operators.js.map +1 -1
  159. package/fesm5/ngxs-store.js +4510 -4399
  160. package/fesm5/ngxs-store.js.map +1 -1
  161. package/index.d.ts +8 -8
  162. package/internals/angular.d.ts +3 -3
  163. package/internals/index.d.ts +6 -7
  164. package/internals/initial-state.d.ts +8 -8
  165. package/internals/internal-tokens.d.ts +9 -9
  166. package/internals/memoize.d.ts +9 -9
  167. package/internals/ngxs-bootstrapper.d.ts +13 -13
  168. package/internals/ngxs-store-internals.d.ts +4 -4
  169. package/internals/ngxs-store-internals.metadata.json +1 -1
  170. package/internals/src/symbols.d.ts +7 -7
  171. package/internals/symbols.d.ts +7 -7
  172. package/ngxs-store.d.ts +23 -20
  173. package/ngxs-store.metadata.json +1 -1
  174. package/operators/append.d.ts +6 -6
  175. package/operators/compose.d.ts +2 -2
  176. package/operators/iif.d.ts +11 -11
  177. package/operators/index.d.ts +13 -13
  178. package/operators/insert-item.d.ts +7 -7
  179. package/operators/internals.d.ts +2 -2
  180. package/operators/ngxs-store-operators.d.ts +4 -4
  181. package/operators/patch.d.ts +10 -10
  182. package/operators/remove-item.d.ts +7 -7
  183. package/operators/update-item.d.ts +10 -10
  184. package/operators/utils.d.ts +9 -9
  185. package/package.json +3 -3
  186. package/src/actions/actions.d.ts +15 -15
  187. package/src/actions/symbols.d.ts +21 -21
  188. package/src/actions-stream.d.ts +49 -49
  189. package/src/configs/messages.config.d.ts +30 -11
  190. package/src/decorators/action.d.ts +5 -5
  191. package/src/decorators/select/select-factory.d.ts +14 -13
  192. package/src/decorators/select/select.d.ts +4 -4
  193. package/src/decorators/select/symbols.d.ts +10 -14
  194. package/src/decorators/selector/selector.d.ts +5 -5
  195. package/src/decorators/selector/symbols.d.ts +4 -4
  196. package/src/decorators/selector-options.d.ts +5 -5
  197. package/src/decorators/state.d.ts +6 -6
  198. package/src/execution/dispatch-outside-zone-ngxs-execution-strategy.d.ts +12 -11
  199. package/src/execution/internal-ngxs-execution-strategy.d.ts +7 -7
  200. package/src/execution/noop-ngxs-execution-strategy.d.ts +5 -5
  201. package/src/execution/symbols.d.ts +6 -6
  202. package/src/host-environment/host-environment.d.ts +6 -0
  203. package/src/internal/config-validator.d.ts +10 -0
  204. package/src/internal/dispatcher.d.ts +32 -32
  205. package/src/internal/internals.d.ts +167 -166
  206. package/src/internal/lifecycle-state-manager.d.ts +20 -20
  207. package/src/internal/state-context-factory.d.ts +15 -15
  208. package/src/internal/state-factory.d.ts +58 -57
  209. package/src/internal/state-operations.d.ts +21 -19
  210. package/src/internal/state-operators.d.ts +2 -2
  211. package/src/internal/state-stream.d.ts +9 -9
  212. package/src/ivy/ensure-state-class-is-injectable.d.ts +6 -0
  213. package/src/ivy/ivy-enabled-in-dev-mode.d.ts +14 -6
  214. package/src/module.d.ts +23 -23
  215. package/src/modules/ngxs-feature.module.d.ts +13 -13
  216. package/src/modules/ngxs-root.module.d.ts +13 -13
  217. package/src/operators/leave-ngxs.d.ts +7 -7
  218. package/src/operators/of-action.d.ts +43 -43
  219. package/src/plugin-manager.d.ts +10 -10
  220. package/src/plugin_api.d.ts +5 -5
  221. package/src/public_api.d.ts +17 -17
  222. package/src/public_to_deprecate.d.ts +21 -21
  223. package/src/state-token/state-token.d.ts +7 -7
  224. package/src/state-token/symbols.d.ts +5 -5
  225. package/src/store.d.ts +53 -53
  226. package/src/symbols.d.ts +137 -135
  227. package/src/utils/compose.d.ts +23 -23
  228. package/src/utils/freeze.d.ts +5 -5
  229. package/src/utils/selector-utils.d.ts +23 -23
  230. package/src/utils/store-validators.d.ts +8 -7
  231. package/src/utils/utils.d.ts +46 -46
  232. package/types/index.d.ts +2 -2
  233. package/bundles/ngxs-store-internals-testing.umd.js +0 -475
  234. package/bundles/ngxs-store-internals-testing.umd.js.map +0 -1
  235. package/bundles/ngxs-store-internals-testing.umd.min.js +0 -16
  236. package/bundles/ngxs-store-internals-testing.umd.min.js.map +0 -1
  237. package/esm2015/internals/decorator-injector-adapter.js +0 -162
  238. package/esm2015/internals/testing/fresh-platform.js +0 -90
  239. package/esm2015/internals/testing/helpers/ngxs-test.component.js +0 -22
  240. package/esm2015/internals/testing/helpers/ngxs-test.module.js +0 -24
  241. package/esm2015/internals/testing/index.js +0 -7
  242. package/esm2015/internals/testing/ngxs-store-internals-testing.js +0 -9
  243. package/esm2015/internals/testing/ngxs.setup.js +0 -76
  244. package/esm2015/internals/testing/symbol.js +0 -29
  245. package/esm5/internals/decorator-injector-adapter.js +0 -162
  246. package/esm5/internals/testing/fresh-platform.js +0 -101
  247. package/esm5/internals/testing/helpers/ngxs-test.component.js +0 -32
  248. package/esm5/internals/testing/helpers/ngxs-test.module.js +0 -32
  249. package/esm5/internals/testing/index.js +0 -7
  250. package/esm5/internals/testing/ngxs-store-internals-testing.js +0 -9
  251. package/esm5/internals/testing/ngxs.setup.js +0 -98
  252. package/esm5/internals/testing/symbol.js +0 -29
  253. package/fesm2015/ngxs-store-internals-testing.js +0 -216
  254. package/fesm2015/ngxs-store-internals-testing.js.map +0 -1
  255. package/fesm5/ngxs-store-internals-testing.js +0 -263
  256. package/fesm5/ngxs-store-internals-testing.js.map +0 -1
  257. package/internals/decorator-injector-adapter.d.ts +0 -8
  258. package/internals/testing/fresh-platform.d.ts +0 -1
  259. package/internals/testing/helpers/ngxs-test.component.d.ts +0 -5
  260. package/internals/testing/helpers/ngxs-test.module.d.ts +0 -4
  261. package/internals/testing/index.d.ts +0 -3
  262. package/internals/testing/ngxs-store-internals-testing.d.ts +0 -4
  263. package/internals/testing/ngxs-store-internals-testing.metadata.json +0 -1
  264. package/internals/testing/ngxs.setup.d.ts +0 -7
  265. package/internals/testing/package.json +0 -13
  266. package/internals/testing/symbol.d.ts +0 -14
@@ -1,377 +1,210 @@
1
- import { getPlatform, COMPILER_OPTIONS, Injectable, InjectionToken, ɵɵdirectiveInject, INJECTOR, ɵglobal } from '@angular/core';
1
+ import { getPlatform, COMPILER_OPTIONS, Injectable, InjectionToken } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
3
 
4
- /**
5
- * @fileoverview added by tsickle
6
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7
- */
8
- /**
9
- * @param {?} a
10
- * @param {?} b
11
- * @return {?}
12
- */
13
- function defaultEqualityCheck(a, b) {
14
- return a === b;
15
- }
16
- /**
17
- * @param {?} equalityCheck
18
- * @param {?} prev
19
- * @param {?} next
20
- * @return {?}
21
- */
22
- function areArgumentsShallowlyEqual(equalityCheck, prev, next) {
23
- if (prev === null || next === null || prev.length !== next.length) {
24
- return false;
25
- }
26
- // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
27
- /** @type {?} */
28
- const length = prev.length;
29
- for (let i = 0; i < length; i++) {
30
- if (!equalityCheck(prev[i], next[i])) {
31
- return false;
32
- }
33
- }
34
- return true;
35
- }
36
- /**
37
- * Memoize a function on its last inputs only.
38
- * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js
39
- *
40
- * @ignore
41
- * @template T
42
- * @param {?} func
43
- * @param {?=} equalityCheck
44
- * @return {?}
45
- */
46
- function memoize(func, equalityCheck = defaultEqualityCheck) {
47
- /** @type {?} */
48
- let lastArgs = null;
49
- /** @type {?} */
50
- let lastResult = null;
51
- // we reference arguments instead of spreading them for performance reasons
52
- /**
53
- * @return {?}
54
- */
55
- function memoized() {
56
- if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {
57
- // apply arguments instead of spreading for performance.
58
- lastResult = ((/** @type {?} */ (func))).apply(null, arguments);
59
- }
60
- lastArgs = arguments;
61
- return lastResult;
62
- }
63
- ((/** @type {?} */ (memoized))).reset = (/**
64
- * @return {?}
65
- */
66
- function () {
67
- // The hidden (for now) ability to reset the memoization
68
- lastArgs = null;
69
- lastResult = null;
70
- });
71
- return (/** @type {?} */ (memoized));
4
+ /**
5
+ * @fileoverview added by tsickle
6
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7
+ */
8
+ /**
9
+ * @param {?} a
10
+ * @param {?} b
11
+ * @return {?}
12
+ */
13
+ function defaultEqualityCheck(a, b) {
14
+ return a === b;
15
+ }
16
+ /**
17
+ * @param {?} equalityCheck
18
+ * @param {?} prev
19
+ * @param {?} next
20
+ * @return {?}
21
+ */
22
+ function areArgumentsShallowlyEqual(equalityCheck, prev, next) {
23
+ if (prev === null || next === null || prev.length !== next.length) {
24
+ return false;
25
+ }
26
+ // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
27
+ /** @type {?} */
28
+ const length = prev.length;
29
+ for (let i = 0; i < length; i++) {
30
+ if (!equalityCheck(prev[i], next[i])) {
31
+ return false;
32
+ }
33
+ }
34
+ return true;
35
+ }
36
+ /**
37
+ * Memoize a function on its last inputs only.
38
+ * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js
39
+ *
40
+ * @ignore
41
+ * @template T
42
+ * @param {?} func
43
+ * @param {?=} equalityCheck
44
+ * @return {?}
45
+ */
46
+ function memoize(func, equalityCheck = defaultEqualityCheck) {
47
+ /** @type {?} */
48
+ let lastArgs = null;
49
+ /** @type {?} */
50
+ let lastResult = null;
51
+ // we reference arguments instead of spreading them for performance reasons
52
+ /**
53
+ * @return {?}
54
+ */
55
+ function memoized() {
56
+ if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {
57
+ // apply arguments instead of spreading for performance.
58
+ lastResult = ((/** @type {?} */ (func))).apply(null, arguments);
59
+ }
60
+ lastArgs = arguments;
61
+ return lastResult;
62
+ }
63
+ ((/** @type {?} */ (memoized))).reset = (/**
64
+ * @return {?}
65
+ */
66
+ function () {
67
+ // The hidden (for now) ability to reset the memoization
68
+ lastArgs = null;
69
+ lastResult = null;
70
+ });
71
+ return (/** @type {?} */ (memoized));
72
72
  }
73
73
 
74
- /**
75
- * @fileoverview added by tsickle
76
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
77
- */
78
- /**
79
- * @return {?}
80
- */
81
- function _isAngularInTestMode() {
82
- /** @type {?} */
83
- const platformRef = getPlatform();
84
- if (!platformRef)
85
- return false;
86
- /** @type {?} */
87
- const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);
88
- if (!compilerOptions)
89
- return false;
90
- /** @type {?} */
91
- const isInTestMode = compilerOptions.some((/**
92
- * @param {?} item
93
- * @return {?}
94
- */
95
- (item) => {
96
- /** @type {?} */
97
- const providers = (item && item.providers) || [];
98
- return providers.some((/**
99
- * @param {?} provider
100
- * @return {?}
101
- */
102
- (provider) => {
103
- return ((provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||
104
- false);
105
- }));
106
- }));
107
- return isInTestMode;
108
- }
109
- /** @type {?} */
110
- const isAngularInTestMode =
111
- // Caretaker note: we have still left the `typeof` condition in order to avoid
112
- // creating a breaking change for projects that still use the View Engine.
113
- typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : (/**
114
- * @return {?}
115
- */
116
- () => false);
74
+ /**
75
+ * @fileoverview added by tsickle
76
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
77
+ */
78
+ /**
79
+ * @return {?}
80
+ */
81
+ function _isAngularInTestMode() {
82
+ /** @type {?} */
83
+ const platformRef = getPlatform();
84
+ if (!platformRef)
85
+ return false;
86
+ /** @type {?} */
87
+ const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);
88
+ if (!compilerOptions)
89
+ return false;
90
+ /** @type {?} */
91
+ const isInTestMode = compilerOptions.some((/**
92
+ * @param {?} item
93
+ * @return {?}
94
+ */
95
+ (item) => {
96
+ /** @type {?} */
97
+ const providers = (item && item.providers) || [];
98
+ return providers.some((/**
99
+ * @param {?} provider
100
+ * @return {?}
101
+ */
102
+ (provider) => {
103
+ return ((provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||
104
+ false);
105
+ }));
106
+ }));
107
+ return isInTestMode;
108
+ }
109
+ /** @type {?} */
110
+ const isAngularInTestMode = memoize(_isAngularInTestMode);
117
111
 
118
- /**
119
- * @fileoverview added by tsickle
120
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
121
- */
122
- class NgxsBootstrapper {
123
- constructor() {
124
- /**
125
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
126
- */
127
- this.bootstrap$ = new ReplaySubject(1);
128
- }
129
- /**
130
- * @return {?}
131
- */
132
- get appBootstrapped$() {
133
- return this.bootstrap$.asObservable();
134
- }
135
- /**
136
- * This event will be emitted after attaching `ComponentRef` of the root component
137
- * to the tree of views, that's a signal that application has been fully rendered
138
- * @return {?}
139
- */
140
- bootstrap() {
141
- this.bootstrap$.next(true);
142
- this.bootstrap$.complete();
143
- }
144
- }
145
- NgxsBootstrapper.decorators = [
146
- { type: Injectable }
147
- ];
148
- if (false) {
149
- /**
150
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
151
- * @type {?}
152
- * @private
153
- */
154
- NgxsBootstrapper.prototype.bootstrap$;
112
+ /**
113
+ * @fileoverview added by tsickle
114
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
115
+ */
116
+ class NgxsBootstrapper {
117
+ constructor() {
118
+ /**
119
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
120
+ */
121
+ this.bootstrap$ = new ReplaySubject(1);
122
+ }
123
+ /**
124
+ * @return {?}
125
+ */
126
+ get appBootstrapped$() {
127
+ return this.bootstrap$.asObservable();
128
+ }
129
+ /**
130
+ * This event will be emitted after attaching `ComponentRef` of the root component
131
+ * to the tree of views, that's a signal that application has been fully rendered
132
+ * @return {?}
133
+ */
134
+ bootstrap() {
135
+ this.bootstrap$.next(true);
136
+ this.bootstrap$.complete();
137
+ }
138
+ }
139
+ NgxsBootstrapper.decorators = [
140
+ { type: Injectable }
141
+ ];
142
+ if (false) {
143
+ /**
144
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
145
+ * @type {?}
146
+ * @private
147
+ */
148
+ NgxsBootstrapper.prototype.bootstrap$;
155
149
  }
156
150
 
157
- /**
158
- * @fileoverview added by tsickle
159
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
160
- */
161
- /** @type {?} */
162
- const INITIAL_STATE_TOKEN = new InjectionToken('INITIAL_STATE_TOKEN');
163
- class InitialState {
164
- /**
165
- * @param {?} state
166
- * @return {?}
167
- */
168
- static set(state) {
169
- this.value = state;
170
- }
171
- /**
172
- * @return {?}
173
- */
174
- static pop() {
175
- /** @type {?} */
176
- const state = this.value;
177
- this.value = {};
178
- return state;
179
- }
180
- }
181
- InitialState.value = {};
182
- if (false) {
183
- /**
184
- * @type {?}
185
- * @private
186
- */
187
- InitialState.value;
151
+ /**
152
+ * @fileoverview added by tsickle
153
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
154
+ */
155
+ /** @type {?} */
156
+ const INITIAL_STATE_TOKEN = new InjectionToken('INITIAL_STATE_TOKEN');
157
+ class InitialState {
158
+ /**
159
+ * @param {?} state
160
+ * @return {?}
161
+ */
162
+ static set(state) {
163
+ this.value = state;
164
+ }
165
+ /**
166
+ * @return {?}
167
+ */
168
+ static pop() {
169
+ /** @type {?} */
170
+ const state = this.value;
171
+ this.value = {};
172
+ return state;
173
+ }
174
+ }
175
+ InitialState.value = {};
176
+ if (false) {
177
+ /**
178
+ * @type {?}
179
+ * @private
180
+ */
181
+ InitialState.value;
188
182
  }
189
183
 
190
- /**
191
- * @fileoverview added by tsickle
192
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
193
- */
194
- /**
195
- * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally
196
- * @type {?}
197
- */
198
- const NGXS_STATE_CONTEXT_FACTORY = new InjectionToken('Internals.StateContextFactory');
199
- /**
200
- * @see StateFactory as it's referenced by this token to be accessed by plugins internally
201
- * @type {?}
202
- */
184
+ /**
185
+ * @fileoverview added by tsickle
186
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
187
+ */
188
+ /**
189
+ * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally
190
+ * @type {?}
191
+ */
192
+ const NGXS_STATE_CONTEXT_FACTORY = new InjectionToken('Internals.StateContextFactory');
193
+ /**
194
+ * @see StateFactory as it's referenced by this token to be accessed by plugins internally
195
+ * @type {?}
196
+ */
203
197
  const NGXS_STATE_FACTORY = new InjectionToken('Internals.StateFactory');
204
198
 
205
- /**
206
- * @fileoverview added by tsickle
207
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
208
- */
209
- // Angular doesn't export `NG_FACTORY_DEF`.
210
- /** @type {?} */
211
- const NG_FACTORY_DEF = 'ɵfac';
212
- // A `Symbol` which is used to save the `Injector` onto the class instance.
213
- /** @type {?} */
214
- const InjectorInstance = Symbol('InjectorInstance');
215
- // A `Symbol` which is used to determine if factory has been decorated previously or not.
216
- /** @type {?} */
217
- const FactoryHasBeenDecorated = Symbol('FactoryHasBeenDecorated');
218
- // eslint-disable-next-line @typescript-eslint/ban-types
219
- /**
220
- * @param {?} target
221
- * @return {?}
222
- */
223
- function ensureLocalInjectorCaptured(target) {
224
- if (FactoryHasBeenDecorated in target.constructor.prototype) {
225
- return;
226
- }
227
- /** @type {?} */
228
- const constructor = target.constructor;
229
- // Means we're in AOT mode.
230
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
231
- decorateFactory(constructor);
232
- }
233
- else if (ngDevMode) {
234
- // We're running in JIT mode and that means we're not able to get the compiled definition
235
- // on the class inside the property decorator during the current message loop tick. We have
236
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
237
- // resolved even before the `APP_INITIALIZER` is resolved.
238
- // The below code also will be executed only in development mode, since it's never recommended
239
- // to use the JIT compiler in production mode (by setting "aot: false").
240
- decorateFactoryLater(constructor);
241
- }
242
- target.constructor.prototype[FactoryHasBeenDecorated] = true;
243
- }
244
- /**
245
- * @template T
246
- * @param {?} instance
247
- * @param {?} token
248
- * @return {?}
249
- */
250
- function localInject(instance, token) {
251
- /** @type {?} */
252
- const injector = instance[InjectorInstance];
253
- return injector ? injector.get(token) : null;
254
- }
255
- /**
256
- * @param {?} constructor
257
- * @return {?}
258
- */
259
- function decorateFactory(constructor) {
260
- /** @type {?} */
261
- const factory = constructor[NG_FACTORY_DEF];
262
- if (typeof factory !== 'function') {
263
- return;
264
- }
265
- // Let's try to get any definition.
266
- // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first
267
- // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).
268
- /** @type {?} */
269
- const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;
270
- /** @type {?} */
271
- const decoratedFactory = (/**
272
- * @return {?}
273
- */
274
- () => {
275
- /** @type {?} */
276
- const instance = factory();
277
- // Caretaker note: `inject()` won't work here.
278
- // We can use the `directiveInject` only during the component
279
- // construction, since Angular captures the currently active injector.
280
- // We're not able to use this function inside the getter (when the `selectorId` property is
281
- // requested for the first time), since the currently active injector will be null.
282
- instance[InjectorInstance] = ɵɵdirectiveInject(
283
- // We're using `INJECTOR` token except of the `Injector` class since the compiler
284
- // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.
285
- // Caretaker note: that this is the same way of getting the injector.
286
- INJECTOR);
287
- return instance;
288
- });
289
- // If we've found any definition then it's enough to override the `def.factory` since Angular
290
- // code uses the `def.factory` and then fallbacks to `ɵfac`.
291
- if (def) {
292
- def.factory = decoratedFactory;
293
- }
294
- // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular
295
- // still uses the `ɵfac`.
296
- Object.defineProperty(constructor, NG_FACTORY_DEF, {
297
- get: (/**
298
- * @return {?}
299
- */
300
- () => decoratedFactory)
301
- });
302
- }
303
- /**
304
- * @param {?} constructor
305
- * @return {?}
306
- */
307
- function decorateFactoryLater(constructor) {
308
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
309
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
310
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
311
- // Promise.then from within a sync test`.
312
- try {
313
- Promise.resolve().then((/**
314
- * @return {?}
315
- */
316
- () => {
317
- decorateFactory(constructor);
318
- }));
319
- }
320
- catch (_a) {
321
- // This is kind of a "hack", but we try to be backwards-compatible,
322
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
323
- ɵglobal.process &&
324
- ɵglobal.process.nextTick &&
325
- ɵglobal.process.nextTick((/**
326
- * @return {?}
327
- */
328
- () => {
329
- decorateFactory(constructor);
330
- }));
331
- }
332
- }
333
- /**
334
- * @record
335
- */
336
- function Definition() { }
337
- if (false) {
338
- /** @type {?} */
339
- Definition.prototype.factory;
340
- }
341
- /**
342
- * @record
343
- */
344
- function ConstructorWithDefinitionAndFactory() { }
345
- if (false) {
346
- /** @type {?|undefined} */
347
- ConstructorWithDefinitionAndFactory.prototype.ɵprov;
348
- /** @type {?|undefined} */
349
- ConstructorWithDefinitionAndFactory.prototype.ɵpipe;
350
- /** @type {?|undefined} */
351
- ConstructorWithDefinitionAndFactory.prototype.ɵcmp;
352
- /** @type {?|undefined} */
353
- ConstructorWithDefinitionAndFactory.prototype.ɵdir;
354
- /* Skipping unnamed member:
355
- [NG_FACTORY_DEF]?: Factory;*/
356
- }
357
- /**
358
- * @record
359
- */
360
- function PrivateInstance() { }
361
- if (false) {
362
- /* Skipping unnamed member:
363
- [InjectorInstance]?: Injector;*/
364
- }
365
-
366
- /**
367
- * @fileoverview added by tsickle
368
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
199
+ /**
200
+ * @fileoverview added by tsickle
201
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
369
202
  */
370
203
 
371
- /**
372
- * @fileoverview added by tsickle
373
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
204
+ /**
205
+ * @fileoverview added by tsickle
206
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
374
207
  */
375
208
 
376
- export { INITIAL_STATE_TOKEN, InitialState, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, NgxsBootstrapper, ensureLocalInjectorCaptured, isAngularInTestMode, localInject, memoize };
209
+ export { INITIAL_STATE_TOKEN, InitialState, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, NgxsBootstrapper, isAngularInTestMode, memoize };
377
210
  //# sourceMappingURL=ngxs-store-internals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { getPlatform, COMPILER_OPTIONS, CompilerOptions, PlatformRef } from '@angular/core';\nimport { memoize } from './memoize';\n\n/**\n * @description Will be provided through Terser global definitions by Angular CLI\n * during the production build. This is how Angular does tree-shaking internally.\n */\ndeclare const ngDevMode: boolean;\n\nfunction _isAngularInTestMode(): boolean {\n const platformRef: PlatformRef | null = getPlatform();\n if (!platformRef) return false;\n const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);\n if (!compilerOptions) return false;\n const isInTestMode = compilerOptions.some((item: CompilerOptions) => {\n const providers = (item && item.providers) || [];\n return providers.some((provider: any) => {\n return (\n (provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||\n false\n );\n });\n });\n return isInTestMode;\n}\n\nexport const isAngularInTestMode =\n // Caretaker note: we have still left the `typeof` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : () => false;\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;CAChB;;;;;;;AAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;IAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,E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;IAID,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,cAAc,EAAE;QACjD,GAAG;;;QAAE,MAAM,gBAAgB,CAAA;KAC5B,CAAC,CAAC;CACJ;;;;;AAED,SAAS,oBAAoB,CAAC,WAAgD;;;;;IAK5E,IAAI;QACF,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI;;;QAAC;YACrB,eAAe,CAAC,WAAW,CAAC,CAAC;SAC9B,EAAC,CAAC;KACJ;IAAC,WAAM;;;QAGN,OAAO,CAAC,OAAO;YACb,OAAO,CAAC,OAAO,CAAC,QAAQ;YACxB,OAAO,CAAC,OAAO,CAAC,QAAQ;;;YAAC;gBACvB,eAAe,CAAC,WAAW,CAAC,CAAC;aAC9B,EAAC,CAAC;KACN;CACF;;;;AAQD,yBAEC;;;IADC,6BAAwB;;;;;AAG1B,kDAUC;;;IARC,oDAAmB;;IAEnB,oDAAmB;;IAEnB,mDAAkB;;IAElB,mDAAkB;;;;;;;AAIpB,8BAEC;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts"],"sourcesContent":["function defaultEqualityCheck(a: any, b: any) {\r\n return a === b;\r\n}\r\n\r\nfunction areArgumentsShallowlyEqual(\r\n equalityCheck: (a: any, b: any) => boolean,\r\n prev: IArguments | null,\r\n next: IArguments | null\r\n) {\r\n if (prev === null || next === null || prev.length !== next.length) {\r\n return false;\r\n }\r\n\r\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\r\n const length = prev.length;\r\n for (let i = 0; i < length; i++) {\r\n if (!equalityCheck(prev[i], next[i])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}\r\n\r\n/**\r\n * Memoize a function on its last inputs only.\r\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\r\n *\r\n * @ignore\r\n */\r\nexport function memoize<T extends (...args: any[]) => any>(\r\n func: T,\r\n equalityCheck = defaultEqualityCheck\r\n): T {\r\n let lastArgs: IArguments | null = null;\r\n let lastResult: any = null;\r\n // we reference arguments instead of spreading them for performance reasons\r\n function memoized() {\r\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\r\n // apply arguments instead of spreading for performance.\r\n lastResult = (<Function>func).apply(null, arguments);\r\n }\r\n\r\n lastArgs = arguments;\r\n return lastResult;\r\n }\r\n (<any>memoized).reset = function() {\r\n // The hidden (for now) ability to reset the memoization\r\n lastArgs = null;\r\n lastResult = null;\r\n };\r\n return memoized as T;\r\n}\r\n","import { getPlatform, COMPILER_OPTIONS, CompilerOptions, PlatformRef } from '@angular/core';\r\nimport { memoize } from './memoize';\r\n\r\nfunction _isAngularInTestMode() {\r\n const platformRef: PlatformRef | null = getPlatform();\r\n if (!platformRef) return false;\r\n const compilerOptions = platformRef.injector.get<any>(COMPILER_OPTIONS, null);\r\n if (!compilerOptions) return false;\r\n const isInTestMode = compilerOptions.some((item: CompilerOptions) => {\r\n const providers = (item && item.providers) || [];\r\n return providers.some((provider: any) => {\r\n return (\r\n (provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||\r\n false\r\n );\r\n });\r\n });\r\n return isInTestMode;\r\n}\r\n\r\nexport const isAngularInTestMode = memoize(_isAngularInTestMode);\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable, ReplaySubject } from 'rxjs';\r\n\r\n@Injectable()\r\nexport class NgxsBootstrapper {\r\n /**\r\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\r\n */\r\n private bootstrap$ = new ReplaySubject<boolean>(1);\r\n\r\n get appBootstrapped$(): Observable<boolean> {\r\n return this.bootstrap$.asObservable();\r\n }\r\n\r\n /**\r\n * This event will be emitted after attaching `ComponentRef` of the root component\r\n * to the tree of views, that's a signal that application has been fully rendered\r\n */\r\n bootstrap(): void {\r\n this.bootstrap$.next(true);\r\n this.bootstrap$.complete();\r\n }\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\nimport { PlainObject } from './symbols';\r\n\r\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\r\n\r\nexport class InitialState {\r\n private static value: PlainObject = {};\r\n\r\n public static set(state: PlainObject) {\r\n this.value = state;\r\n }\r\n\r\n public static pop(): PlainObject {\r\n const state: PlainObject = this.value;\r\n this.value = {};\r\n return state;\r\n }\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\n\r\n/**\r\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\r\n */\r\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\r\n 'Internals.StateContextFactory'\r\n);\r\n\r\n/**\r\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\r\n */\r\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\r\n 'Internals.StateFactory'\r\n);\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;CAChB;;;;;;;AAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;IAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;QACjE,OAAO,KAAK,CAAC;KACd;;;UAGK,MAAM,GAAG,IAAI,CAAC,MAAM;IAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YACpC,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,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