@ngxs/store 3.7.3-dev.master-5175b98 → 3.7.3

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 (267) hide show
  1. package/README.md +16 -16
  2. package/bundles/ngxs-store-internals-testing.umd.js +215 -235
  3. package/bundles/ngxs-store-internals-testing.umd.js.map +1 -1
  4. package/bundles/ngxs-store-internals-testing.umd.min.js +2 -2
  5. package/bundles/ngxs-store-internals-testing.umd.min.js.map +1 -1
  6. package/bundles/ngxs-store-internals.umd.js +211 -422
  7. package/bundles/ngxs-store-internals.umd.js.map +1 -1
  8. package/bundles/ngxs-store-internals.umd.min.js +1 -1
  9. package/bundles/ngxs-store-internals.umd.min.js.map +1 -1
  10. package/bundles/ngxs-store-operators.umd.js +310 -311
  11. package/bundles/ngxs-store-operators.umd.js.map +1 -1
  12. package/bundles/ngxs-store-operators.umd.min.js +1 -1
  13. package/bundles/ngxs-store-operators.umd.min.js.map +1 -1
  14. package/bundles/ngxs-store.umd.js +4518 -4423
  15. package/bundles/ngxs-store.umd.js.map +1 -1
  16. package/bundles/ngxs-store.umd.min.js +1 -1
  17. package/bundles/ngxs-store.umd.min.js.map +1 -1
  18. package/esm2015/index.js +13 -13
  19. package/esm2015/internals/angular.js +40 -46
  20. package/esm2015/internals/index.js +10 -11
  21. package/esm2015/internals/initial-state.js +34 -34
  22. package/esm2015/internals/internal-tokens.js +16 -16
  23. package/esm2015/internals/memoize.js +70 -70
  24. package/esm2015/internals/ngxs-bootstrapper.js +41 -41
  25. package/esm2015/internals/ngxs-store-internals.js +9 -9
  26. package/esm2015/internals/src/symbols.js +14 -14
  27. package/esm2015/internals/symbols.js +14 -14
  28. package/esm2015/internals/testing/fresh-platform.js +71 -90
  29. package/esm2015/internals/testing/helpers/ngxs-test.component.js +22 -22
  30. package/esm2015/internals/testing/helpers/ngxs-test.module.js +24 -24
  31. package/esm2015/internals/testing/index.js +7 -7
  32. package/esm2015/internals/testing/ngxs-store-internals-testing.js +8 -8
  33. package/esm2015/internals/testing/ngxs.setup.js +76 -76
  34. package/esm2015/internals/testing/symbol.js +29 -29
  35. package/esm2015/ngxs-store.js +27 -24
  36. package/esm2015/operators/append.js +31 -31
  37. package/esm2015/operators/compose.js +24 -24
  38. package/esm2015/operators/iif.js +56 -56
  39. package/esm2015/operators/index.js +18 -18
  40. package/esm2015/operators/insert-item.js +41 -41
  41. package/esm2015/operators/internals.js +5 -5
  42. package/esm2015/operators/ngxs-store-operators.js +8 -8
  43. package/esm2015/operators/patch.js +39 -38
  44. package/esm2015/operators/remove-item.js +34 -34
  45. package/esm2015/operators/update-item.js +52 -54
  46. package/esm2015/operators/utils.js +50 -50
  47. package/esm2015/src/actions/actions.js +39 -39
  48. package/esm2015/src/actions/symbols.js +39 -39
  49. package/esm2015/src/actions-stream.js +140 -138
  50. package/esm2015/src/configs/messages.config.js +87 -79
  51. package/esm2015/src/decorators/action.js +44 -48
  52. package/esm2015/src/decorators/select/select-factory.js +46 -49
  53. package/esm2015/src/decorators/select/select.js +45 -81
  54. package/esm2015/src/decorators/select/symbols.js +50 -94
  55. package/esm2015/src/decorators/selector/selector.js +55 -59
  56. package/esm2015/src/decorators/selector/symbols.js +5 -5
  57. package/esm2015/src/decorators/selector-options.js +34 -34
  58. package/esm2015/src/decorators/state.js +75 -83
  59. package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +96 -101
  60. package/esm2015/src/execution/internal-ngxs-execution-strategy.js +45 -45
  61. package/esm2015/src/execution/noop-ngxs-execution-strategy.js +27 -27
  62. package/esm2015/src/execution/symbols.js +29 -29
  63. package/esm2015/src/host-environment/host-environment.js +31 -0
  64. package/esm2015/src/internal/config-validator.js +67 -0
  65. package/esm2015/src/internal/dispatcher.js +217 -217
  66. package/esm2015/src/internal/internals.js +489 -493
  67. package/esm2015/src/internal/lifecycle-state-manager.js +129 -129
  68. package/esm2015/src/internal/state-context-factory.js +138 -138
  69. package/esm2015/src/internal/state-factory.js +429 -449
  70. package/esm2015/src/internal/state-operations.js +125 -120
  71. package/esm2015/src/internal/state-operators.js +33 -33
  72. package/esm2015/src/internal/state-stream.js +21 -21
  73. package/esm2015/src/ivy/ensure-state-class-is-injectable.js +34 -0
  74. package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +40 -28
  75. package/esm2015/src/module.js +172 -158
  76. package/esm2015/src/modules/ngxs-feature.module.js +63 -63
  77. package/esm2015/src/modules/ngxs-root.module.js +52 -52
  78. package/esm2015/src/operators/leave-ngxs.js +58 -58
  79. package/esm2015/src/operators/of-action.js +191 -191
  80. package/esm2015/src/plugin-manager.js +70 -70
  81. package/esm2015/src/plugin_api.js +10 -10
  82. package/esm2015/src/public_api.js +29 -29
  83. package/esm2015/src/public_to_deprecate.js +64 -64
  84. package/esm2015/src/state-token/state-token.js +45 -45
  85. package/esm2015/src/state-token/symbols.js +5 -5
  86. package/esm2015/src/store.js +174 -174
  87. package/esm2015/src/symbols.js +221 -217
  88. package/esm2015/src/utils/compose.js +44 -44
  89. package/esm2015/src/utils/freeze.js +35 -35
  90. package/esm2015/src/utils/selector-utils.js +221 -221
  91. package/esm2015/src/utils/store-validators.js +65 -60
  92. package/esm2015/src/utils/utils.js +143 -143
  93. package/esm5/index.js +13 -13
  94. package/esm5/internals/angular.js +40 -46
  95. package/esm5/internals/index.js +10 -11
  96. package/esm5/internals/initial-state.js +45 -45
  97. package/esm5/internals/internal-tokens.js +16 -16
  98. package/esm5/internals/memoize.js +71 -71
  99. package/esm5/internals/ngxs-bootstrapper.js +56 -56
  100. package/esm5/internals/ngxs-store-internals.js +9 -9
  101. package/esm5/internals/src/symbols.js +14 -14
  102. package/esm5/internals/symbols.js +14 -14
  103. package/esm5/internals/testing/fresh-platform.js +81 -101
  104. package/esm5/internals/testing/helpers/ngxs-test.component.js +32 -32
  105. package/esm5/internals/testing/helpers/ngxs-test.module.js +32 -32
  106. package/esm5/internals/testing/index.js +7 -7
  107. package/esm5/internals/testing/ngxs-store-internals-testing.js +8 -8
  108. package/esm5/internals/testing/ngxs.setup.js +98 -98
  109. package/esm5/internals/testing/symbol.js +29 -29
  110. package/esm5/ngxs-store.js +27 -24
  111. package/esm5/operators/append.js +31 -31
  112. package/esm5/operators/compose.js +28 -28
  113. package/esm5/operators/iif.js +56 -56
  114. package/esm5/operators/index.js +18 -18
  115. package/esm5/operators/insert-item.js +41 -41
  116. package/esm5/operators/internals.js +5 -5
  117. package/esm5/operators/ngxs-store-operators.js +8 -8
  118. package/esm5/operators/patch.js +40 -39
  119. package/esm5/operators/remove-item.js +34 -34
  120. package/esm5/operators/update-item.js +52 -54
  121. package/esm5/operators/utils.js +50 -50
  122. package/esm5/src/actions/actions.js +62 -62
  123. package/esm5/src/actions/symbols.js +39 -39
  124. package/esm5/src/actions-stream.js +186 -184
  125. package/esm5/src/configs/messages.config.js +104 -79
  126. package/esm5/src/decorators/action.js +56 -60
  127. package/esm5/src/decorators/select/select-factory.js +47 -50
  128. package/esm5/src/decorators/select/select.js +50 -87
  129. package/esm5/src/decorators/select/symbols.js +51 -95
  130. package/esm5/src/decorators/selector/selector.js +55 -59
  131. package/esm5/src/decorators/selector/symbols.js +5 -5
  132. package/esm5/src/decorators/selector-options.js +34 -34
  133. package/esm5/src/decorators/state.js +76 -84
  134. package/esm5/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +121 -121
  135. package/esm5/src/execution/internal-ngxs-execution-strategy.js +54 -54
  136. package/esm5/src/execution/noop-ngxs-execution-strategy.js +41 -41
  137. package/esm5/src/execution/symbols.js +29 -29
  138. package/esm5/src/host-environment/host-environment.js +29 -0
  139. package/esm5/src/internal/config-validator.js +76 -0
  140. package/esm5/src/internal/dispatcher.js +253 -253
  141. package/esm5/src/internal/internals.js +491 -495
  142. package/esm5/src/internal/lifecycle-state-manager.js +177 -177
  143. package/esm5/src/internal/state-context-factory.js +146 -146
  144. package/esm5/src/internal/state-factory.js +563 -575
  145. package/esm5/src/internal/state-operations.js +139 -130
  146. package/esm5/src/internal/state-operators.js +34 -34
  147. package/esm5/src/internal/state-stream.js +25 -25
  148. package/esm5/src/ivy/ensure-state-class-is-injectable.js +34 -0
  149. package/esm5/src/ivy/ivy-enabled-in-dev-mode.js +40 -28
  150. package/esm5/src/module.js +215 -201
  151. package/esm5/src/modules/ngxs-feature.module.js +65 -65
  152. package/esm5/src/modules/ngxs-root.module.js +47 -47
  153. package/esm5/src/operators/leave-ngxs.js +58 -58
  154. package/esm5/src/operators/of-action.js +217 -217
  155. package/esm5/src/plugin-manager.js +82 -82
  156. package/esm5/src/plugin_api.js +10 -10
  157. package/esm5/src/public_api.js +29 -29
  158. package/esm5/src/public_to_deprecate.js +64 -64
  159. package/esm5/src/state-token/state-token.js +57 -57
  160. package/esm5/src/state-token/symbols.js +5 -5
  161. package/esm5/src/store.js +225 -225
  162. package/esm5/src/symbols.js +230 -226
  163. package/esm5/src/utils/compose.js +55 -55
  164. package/esm5/src/utils/freeze.js +35 -35
  165. package/esm5/src/utils/selector-utils.js +230 -230
  166. package/esm5/src/utils/store-validators.js +86 -78
  167. package/esm5/src/utils/utils.js +151 -151
  168. package/fesm2015/ngxs-store-internals-testing.js +175 -194
  169. package/fesm2015/ngxs-store-internals-testing.js.map +1 -1
  170. package/fesm2015/ngxs-store-internals.js +194 -402
  171. package/fesm2015/ngxs-store-internals.js.map +1 -1
  172. package/fesm2015/ngxs-store-operators.js +312 -313
  173. package/fesm2015/ngxs-store-operators.js.map +1 -1
  174. package/fesm2015/ngxs-store.js +3976 -3927
  175. package/fesm2015/ngxs-store.js.map +1 -1
  176. package/fesm5/ngxs-store-internals-testing.js +221 -241
  177. package/fesm5/ngxs-store-internals-testing.js.map +1 -1
  178. package/fesm5/ngxs-store-internals.js +219 -427
  179. package/fesm5/ngxs-store-internals.js.map +1 -1
  180. package/fesm5/ngxs-store-operators.js +316 -317
  181. package/fesm5/ngxs-store-operators.js.map +1 -1
  182. package/fesm5/ngxs-store.js +4510 -4420
  183. package/fesm5/ngxs-store.js.map +1 -1
  184. package/index.d.ts +8 -8
  185. package/internals/angular.d.ts +3 -3
  186. package/internals/index.d.ts +6 -7
  187. package/internals/initial-state.d.ts +8 -8
  188. package/internals/internal-tokens.d.ts +9 -9
  189. package/internals/memoize.d.ts +9 -9
  190. package/internals/ngxs-bootstrapper.d.ts +13 -13
  191. package/internals/ngxs-store-internals.d.ts +4 -4
  192. package/internals/ngxs-store-internals.metadata.json +1 -1
  193. package/internals/src/symbols.d.ts +7 -7
  194. package/internals/symbols.d.ts +7 -7
  195. package/internals/testing/fresh-platform.d.ts +1 -1
  196. package/internals/testing/helpers/ngxs-test.component.d.ts +5 -5
  197. package/internals/testing/helpers/ngxs-test.module.d.ts +4 -4
  198. package/internals/testing/index.d.ts +3 -3
  199. package/internals/testing/ngxs-store-internals-testing.d.ts +4 -4
  200. package/internals/testing/ngxs-store-internals-testing.metadata.json +1 -1
  201. package/internals/testing/ngxs.setup.d.ts +7 -7
  202. package/internals/testing/symbol.d.ts +14 -14
  203. package/ngxs-store.d.ts +23 -20
  204. package/ngxs-store.metadata.json +1 -1
  205. package/operators/append.d.ts +6 -6
  206. package/operators/compose.d.ts +2 -3
  207. package/operators/iif.d.ts +11 -11
  208. package/operators/index.d.ts +13 -13
  209. package/operators/insert-item.d.ts +7 -7
  210. package/operators/internals.d.ts +2 -2
  211. package/operators/ngxs-store-operators.d.ts +4 -4
  212. package/operators/ngxs-store-operators.metadata.json +1 -1
  213. package/operators/patch.d.ts +10 -6
  214. package/operators/remove-item.d.ts +7 -7
  215. package/operators/update-item.d.ts +10 -10
  216. package/operators/utils.d.ts +9 -10
  217. package/package.json +2 -2
  218. package/src/actions/actions.d.ts +15 -15
  219. package/src/actions/symbols.d.ts +21 -21
  220. package/src/actions-stream.d.ts +49 -49
  221. package/src/configs/messages.config.d.ts +30 -11
  222. package/src/decorators/action.d.ts +5 -5
  223. package/src/decorators/select/select-factory.d.ts +14 -13
  224. package/src/decorators/select/select.d.ts +4 -4
  225. package/src/decorators/select/symbols.d.ts +10 -14
  226. package/src/decorators/selector/selector.d.ts +5 -5
  227. package/src/decorators/selector/symbols.d.ts +4 -4
  228. package/src/decorators/selector-options.d.ts +5 -5
  229. package/src/decorators/state.d.ts +6 -6
  230. package/src/execution/dispatch-outside-zone-ngxs-execution-strategy.d.ts +12 -11
  231. package/src/execution/internal-ngxs-execution-strategy.d.ts +7 -7
  232. package/src/execution/noop-ngxs-execution-strategy.d.ts +5 -5
  233. package/src/execution/symbols.d.ts +6 -6
  234. package/src/host-environment/host-environment.d.ts +6 -0
  235. package/src/internal/config-validator.d.ts +10 -0
  236. package/src/internal/dispatcher.d.ts +32 -32
  237. package/src/internal/internals.d.ts +167 -166
  238. package/src/internal/lifecycle-state-manager.d.ts +20 -20
  239. package/src/internal/state-context-factory.d.ts +15 -15
  240. package/src/internal/state-factory.d.ts +58 -57
  241. package/src/internal/state-operations.d.ts +21 -19
  242. package/src/internal/state-operators.d.ts +2 -2
  243. package/src/internal/state-stream.d.ts +9 -9
  244. package/src/ivy/ensure-state-class-is-injectable.d.ts +6 -0
  245. package/src/ivy/ivy-enabled-in-dev-mode.d.ts +14 -6
  246. package/src/module.d.ts +23 -23
  247. package/src/modules/ngxs-feature.module.d.ts +13 -13
  248. package/src/modules/ngxs-root.module.d.ts +13 -13
  249. package/src/operators/leave-ngxs.d.ts +7 -7
  250. package/src/operators/of-action.d.ts +43 -43
  251. package/src/plugin-manager.d.ts +10 -10
  252. package/src/plugin_api.d.ts +5 -5
  253. package/src/public_api.d.ts +17 -17
  254. package/src/public_to_deprecate.d.ts +21 -21
  255. package/src/state-token/state-token.d.ts +7 -7
  256. package/src/state-token/symbols.d.ts +5 -5
  257. package/src/store.d.ts +53 -53
  258. package/src/symbols.d.ts +137 -135
  259. package/src/utils/compose.d.ts +23 -23
  260. package/src/utils/freeze.d.ts +5 -5
  261. package/src/utils/selector-utils.d.ts +23 -23
  262. package/src/utils/store-validators.d.ts +8 -7
  263. package/src/utils/utils.d.ts +46 -46
  264. package/types/index.d.ts +2 -2
  265. package/esm2015/internals/decorator-injector-adapter.js +0 -204
  266. package/esm5/internals/decorator-injector-adapter.js +0 -204
  267. package/internals/decorator-injector-adapter.d.ts +0 -15
@@ -1,418 +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
- // A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot
219
- // be retrieved within the `constructor` since it's set after the `factory()` is called.
220
- /** @type {?} */
221
- const InjectorNotifier = Symbol('InjectorNotifier');
222
- /**
223
- * @record
224
- */
225
- function PrototypeWithInjectorNotifier() { }
226
- if (false) {
227
- /* Skipping unnamed member:
228
- [InjectorNotifier]?: ReplaySubject<boolean>;*/
229
- }
230
- /**
231
- * @param {?} target
232
- * @return {?}
233
- */
234
- function ensureInjectorNotifierIsCaptured(target) {
235
- if (target[InjectorNotifier]) {
236
- return (/** @type {?} */ (target[InjectorNotifier]));
237
- }
238
- else {
239
- /** @type {?} */
240
- const injectorNotifier$ = new ReplaySubject(1);
241
- Object.defineProperty(target, InjectorNotifier, {
242
- get: (/**
243
- * @return {?}
244
- */
245
- () => injectorNotifier$)
246
- });
247
- return injectorNotifier$;
248
- }
249
- }
250
- // eslint-disable-next-line @typescript-eslint/ban-types
251
- /**
252
- * @param {?} target
253
- * @return {?}
254
- */
255
- function ensureLocalInjectorCaptured(target) {
256
- if (FactoryHasBeenDecorated in target.constructor.prototype) {
257
- return;
258
- }
259
- /** @type {?} */
260
- const constructor = target.constructor;
261
- // Means we're in AOT mode.
262
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
263
- decorateFactory(constructor);
264
- }
265
- else if (ngDevMode) {
266
- // We're running in JIT mode and that means we're not able to get the compiled definition
267
- // on the class inside the property decorator during the current message loop tick. We have
268
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
269
- // resolved even before the `APP_INITIALIZER` is resolved.
270
- // The below code also will be executed only in development mode, since it's never recommended
271
- // to use the JIT compiler in production mode (by setting "aot: false").
272
- decorateFactoryLater(constructor);
273
- }
274
- target.constructor.prototype[FactoryHasBeenDecorated] = true;
275
- }
276
- /**
277
- * @template T
278
- * @param {?} instance
279
- * @param {?} token
280
- * @return {?}
281
- */
282
- function localInject(instance, token) {
283
- /** @type {?} */
284
- const injector = instance[InjectorInstance];
285
- return injector ? injector.get(token) : null;
286
- }
287
- /**
288
- * @param {?} constructor
289
- * @return {?}
290
- */
291
- function decorateFactory(constructor) {
292
- /** @type {?} */
293
- const factory = constructor[NG_FACTORY_DEF];
294
- if (typeof factory !== 'function') {
295
- return;
296
- }
297
- // Let's try to get any definition.
298
- // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first
299
- // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).
300
- /** @type {?} */
301
- const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;
302
- /** @type {?} */
303
- const decoratedFactory = (/**
304
- * @return {?}
305
- */
306
- () => {
307
- /** @type {?} */
308
- const instance = factory();
309
- // Caretaker note: `inject()` won't work here.
310
- // We can use the `directiveInject` only during the component
311
- // construction, since Angular captures the currently active injector.
312
- // We're not able to use this function inside the getter (when the `selectorId` property is
313
- // requested for the first time), since the currently active injector will be null.
314
- instance[InjectorInstance] = ɵɵdirectiveInject(
315
- // We're using `INJECTOR` token except of the `Injector` class since the compiler
316
- // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.
317
- // Caretaker note: that this is the same way of getting the injector.
318
- INJECTOR);
319
- // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.
320
- /** @type {?} */
321
- const injectorNotifier$ = instance[InjectorNotifier];
322
- if (injectorNotifier$) {
323
- injectorNotifier$.next(true);
324
- injectorNotifier$.complete();
325
- }
326
- return instance;
327
- });
328
- // If we've found any definition then it's enough to override the `def.factory` since Angular
329
- // code uses the `def.factory` and then fallbacks to `ɵfac`.
330
- if (def) {
331
- def.factory = decoratedFactory;
332
- }
333
- // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular
334
- // still uses the `ɵfac`.
335
- Object.defineProperty(constructor, NG_FACTORY_DEF, {
336
- get: (/**
337
- * @return {?}
338
- */
339
- () => decoratedFactory)
340
- });
341
- }
342
- /**
343
- * @param {?} constructor
344
- * @return {?}
345
- */
346
- function decorateFactoryLater(constructor) {
347
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
348
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
349
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
350
- // Promise.then from within a sync test`.
351
- try {
352
- Promise.resolve().then((/**
353
- * @return {?}
354
- */
355
- () => {
356
- decorateFactory(constructor);
357
- }));
358
- }
359
- catch (_a) {
360
- // This is kind of a "hack", but we try to be backwards-compatible,
361
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
362
- ɵglobal.process &&
363
- ɵglobal.process.nextTick &&
364
- ɵglobal.process.nextTick((/**
365
- * @return {?}
366
- */
367
- () => {
368
- decorateFactory(constructor);
369
- }));
370
- }
371
- }
372
- /**
373
- * @record
374
- */
375
- function Definition() { }
376
- if (false) {
377
- /** @type {?} */
378
- Definition.prototype.factory;
379
- }
380
- /**
381
- * @record
382
- */
383
- function ConstructorWithDefinitionAndFactory() { }
384
- if (false) {
385
- /** @type {?|undefined} */
386
- ConstructorWithDefinitionAndFactory.prototype.ɵprov;
387
- /** @type {?|undefined} */
388
- ConstructorWithDefinitionAndFactory.prototype.ɵpipe;
389
- /** @type {?|undefined} */
390
- ConstructorWithDefinitionAndFactory.prototype.ɵcmp;
391
- /** @type {?|undefined} */
392
- ConstructorWithDefinitionAndFactory.prototype.ɵdir;
393
- /* Skipping unnamed member:
394
- [NG_FACTORY_DEF]?: Factory;*/
395
- }
396
- /**
397
- * @record
398
- */
399
- function PrivateInstance() { }
400
- if (false) {
401
- /* Skipping unnamed member:
402
- [InjectorInstance]?: Injector;*/
403
- /* Skipping unnamed member:
404
- [InjectorNotifier]?: ReplaySubject<boolean>;*/
405
- }
406
-
407
- /**
408
- * @fileoverview added by tsickle
409
- * @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
410
202
  */
411
203
 
412
- /**
413
- * @fileoverview added by tsickle
414
- * @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
415
207
  */
416
208
 
417
- export { INITIAL_STATE_TOKEN, InitialState, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, NgxsBootstrapper, ensureInjectorNotifierIsCaptured, ensureLocalInjectorCaptured, isAngularInTestMode, localInject, memoize };
209
+ export { INITIAL_STATE_TOKEN, InitialState, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, NgxsBootstrapper, isAngularInTestMode, memoize };
418
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';\nimport { ReplaySubject } from 'rxjs';\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// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\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\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\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 [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,oBAAoB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AAQ;;;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,8BAGC;;;;;;;;;;;;;;;;;;;;"}
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,CAAC;CACb;;;;;;;;;;;AAQD,SAAgB,OAAO,CACrB,IAAO,EACP,aAAa,GAAG,oBAAoB;;QAEhC,QAAQ,GAAsB,IAAI;;QAClC,UAAU,GAAQ,IAAI;;;;;IAE1B,SAAS,QAAQ;QACf,IAAI,CAAC,0BAA0B,CAAC,aAAa,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE;;YAEnE,UAAU,GAAG,oBAAW,IAAI,IAAE,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;SACtD;QAED,QAAQ,GAAG,SAAS,CAAC;QACrB,OAAO,UAAU,CAAC;KACnB;IACD,oB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