@ngxs/store 3.7.4 → 3.7.5

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 (257) hide show
  1. package/README.md +16 -16
  2. package/bundles/ngxs-store-internals-testing.umd.js +315 -315
  3. package/bundles/ngxs-store-internals-testing.umd.js.map +1 -1
  4. package/bundles/ngxs-store-internals-testing.umd.min.js.map +1 -1
  5. package/bundles/ngxs-store-internals.umd.js +192 -397
  6. package/bundles/ngxs-store-internals.umd.js.map +1 -1
  7. package/bundles/ngxs-store-internals.umd.min.js +1 -1
  8. package/bundles/ngxs-store-internals.umd.min.js.map +1 -1
  9. package/bundles/ngxs-store-operators.umd.js +310 -310
  10. package/bundles/ngxs-store-operators.umd.js.map +1 -1
  11. package/bundles/ngxs-store-operators.umd.min.js.map +1 -1
  12. package/bundles/ngxs-store.umd.js +4401 -4481
  13. package/bundles/ngxs-store.umd.js.map +1 -1
  14. package/bundles/ngxs-store.umd.min.js +1 -1
  15. package/bundles/ngxs-store.umd.min.js.map +1 -1
  16. package/esm2015/index.js +13 -13
  17. package/esm2015/internals/angular.js +20 -20
  18. package/esm2015/internals/index.js +10 -11
  19. package/esm2015/internals/initial-state.js +34 -34
  20. package/esm2015/internals/internal-tokens.js +16 -16
  21. package/esm2015/internals/memoize.js +70 -70
  22. package/esm2015/internals/ngxs-bootstrapper.js +41 -41
  23. package/esm2015/internals/ngxs-store-internals.js +9 -9
  24. package/esm2015/internals/src/symbols.js +14 -14
  25. package/esm2015/internals/symbols.js +14 -14
  26. package/esm2015/internals/testing/fresh-platform.js +110 -110
  27. package/esm2015/internals/testing/helpers/ngxs-test.component.js +22 -22
  28. package/esm2015/internals/testing/helpers/ngxs-test.module.js +24 -24
  29. package/esm2015/internals/testing/index.js +8 -8
  30. package/esm2015/internals/testing/ngxs-store-internals-testing.js +8 -8
  31. package/esm2015/internals/testing/ngxs.setup.js +76 -76
  32. package/esm2015/internals/testing/skip-console-logging.js +62 -62
  33. package/esm2015/internals/testing/symbol.js +29 -29
  34. package/esm2015/ngxs-store.js +24 -23
  35. package/esm2015/operators/append.js +31 -31
  36. package/esm2015/operators/compose.js +24 -24
  37. package/esm2015/operators/iif.js +56 -56
  38. package/esm2015/operators/index.js +18 -18
  39. package/esm2015/operators/insert-item.js +41 -41
  40. package/esm2015/operators/internals.js +5 -5
  41. package/esm2015/operators/ngxs-store-operators.js +8 -8
  42. package/esm2015/operators/patch.js +39 -39
  43. package/esm2015/operators/remove-item.js +34 -34
  44. package/esm2015/operators/update-item.js +52 -52
  45. package/esm2015/operators/utils.js +50 -50
  46. package/esm2015/src/actions/actions.js +39 -39
  47. package/esm2015/src/actions/symbols.js +39 -39
  48. package/esm2015/src/actions-stream.js +140 -140
  49. package/esm2015/src/configs/messages.config.js +79 -79
  50. package/esm2015/src/decorators/action.js +48 -48
  51. package/esm2015/src/decorators/select/select-factory.js +45 -49
  52. package/esm2015/src/decorators/select/select.js +45 -81
  53. package/esm2015/src/decorators/select/symbols.js +50 -94
  54. package/esm2015/src/decorators/selector/selector.js +59 -59
  55. package/esm2015/src/decorators/selector/symbols.js +5 -5
  56. package/esm2015/src/decorators/selector-options.js +34 -34
  57. package/esm2015/src/decorators/state.js +77 -83
  58. package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +103 -103
  59. package/esm2015/src/execution/internal-ngxs-execution-strategy.js +45 -45
  60. package/esm2015/src/execution/noop-ngxs-execution-strategy.js +29 -29
  61. package/esm2015/src/execution/symbols.js +52 -52
  62. package/esm2015/src/internal/dispatcher.js +219 -217
  63. package/esm2015/src/internal/internals.js +493 -493
  64. package/esm2015/src/internal/lifecycle-state-manager.js +129 -129
  65. package/esm2015/src/internal/state-context-factory.js +138 -138
  66. package/esm2015/src/internal/state-factory.js +457 -449
  67. package/esm2015/src/internal/state-operations.js +124 -133
  68. package/esm2015/src/internal/state-operators.js +33 -33
  69. package/esm2015/src/internal/state-stream.js +30 -30
  70. package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +28 -28
  71. package/esm2015/src/module.js +159 -157
  72. package/esm2015/src/modules/ngxs-feature.module.js +63 -63
  73. package/esm2015/src/modules/ngxs-root.module.js +49 -52
  74. package/esm2015/src/operators/leave-ngxs.js +58 -58
  75. package/esm2015/src/operators/of-action.js +191 -191
  76. package/esm2015/src/plugin-manager.js +70 -70
  77. package/esm2015/src/plugin_api.js +10 -10
  78. package/esm2015/src/public_api.js +29 -29
  79. package/esm2015/src/public_to_deprecate.js +64 -64
  80. package/esm2015/src/state-token/state-token.js +45 -45
  81. package/esm2015/src/state-token/symbols.js +5 -5
  82. package/esm2015/src/store.js +190 -190
  83. package/esm2015/src/symbols.js +221 -220
  84. package/esm2015/src/utils/compose.js +44 -44
  85. package/esm2015/src/utils/freeze.js +35 -35
  86. package/esm2015/src/utils/selector-utils.js +221 -221
  87. package/esm2015/src/utils/store-validators.js +60 -60
  88. package/esm2015/src/utils/utils.js +143 -143
  89. package/esm5/index.js +13 -13
  90. package/esm5/internals/angular.js +20 -20
  91. package/esm5/internals/index.js +10 -11
  92. package/esm5/internals/initial-state.js +45 -45
  93. package/esm5/internals/internal-tokens.js +16 -16
  94. package/esm5/internals/memoize.js +71 -71
  95. package/esm5/internals/ngxs-bootstrapper.js +56 -56
  96. package/esm5/internals/ngxs-store-internals.js +9 -9
  97. package/esm5/internals/src/symbols.js +14 -14
  98. package/esm5/internals/symbols.js +14 -14
  99. package/esm5/internals/testing/fresh-platform.js +121 -121
  100. package/esm5/internals/testing/helpers/ngxs-test.component.js +32 -32
  101. package/esm5/internals/testing/helpers/ngxs-test.module.js +32 -32
  102. package/esm5/internals/testing/index.js +8 -8
  103. package/esm5/internals/testing/ngxs-store-internals-testing.js +8 -8
  104. package/esm5/internals/testing/ngxs.setup.js +98 -98
  105. package/esm5/internals/testing/skip-console-logging.js +62 -62
  106. package/esm5/internals/testing/symbol.js +29 -29
  107. package/esm5/ngxs-store.js +24 -23
  108. package/esm5/operators/append.js +31 -31
  109. package/esm5/operators/compose.js +28 -28
  110. package/esm5/operators/iif.js +56 -56
  111. package/esm5/operators/index.js +18 -18
  112. package/esm5/operators/insert-item.js +41 -41
  113. package/esm5/operators/internals.js +5 -5
  114. package/esm5/operators/ngxs-store-operators.js +8 -8
  115. package/esm5/operators/patch.js +40 -40
  116. package/esm5/operators/remove-item.js +34 -34
  117. package/esm5/operators/update-item.js +52 -52
  118. package/esm5/operators/utils.js +50 -50
  119. package/esm5/src/actions/actions.js +62 -62
  120. package/esm5/src/actions/symbols.js +39 -39
  121. package/esm5/src/actions-stream.js +186 -186
  122. package/esm5/src/configs/messages.config.js +79 -79
  123. package/esm5/src/decorators/action.js +60 -60
  124. package/esm5/src/decorators/select/select-factory.js +46 -50
  125. package/esm5/src/decorators/select/select.js +50 -87
  126. package/esm5/src/decorators/select/symbols.js +51 -95
  127. package/esm5/src/decorators/selector/selector.js +59 -59
  128. package/esm5/src/decorators/selector/symbols.js +5 -5
  129. package/esm5/src/decorators/selector-options.js +34 -34
  130. package/esm5/src/decorators/state.js +78 -84
  131. package/esm5/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +123 -123
  132. package/esm5/src/execution/internal-ngxs-execution-strategy.js +54 -54
  133. package/esm5/src/execution/noop-ngxs-execution-strategy.js +43 -43
  134. package/esm5/src/execution/symbols.js +52 -52
  135. package/esm5/src/internal/dispatcher.js +255 -253
  136. package/esm5/src/internal/internals.js +495 -495
  137. package/esm5/src/internal/lifecycle-state-manager.js +177 -177
  138. package/esm5/src/internal/state-context-factory.js +146 -146
  139. package/esm5/src/internal/state-factory.js +583 -575
  140. package/esm5/src/internal/state-operations.js +134 -143
  141. package/esm5/src/internal/state-operators.js +34 -34
  142. package/esm5/src/internal/state-stream.js +37 -37
  143. package/esm5/src/ivy/ivy-enabled-in-dev-mode.js +28 -28
  144. package/esm5/src/module.js +202 -200
  145. package/esm5/src/modules/ngxs-feature.module.js +65 -65
  146. package/esm5/src/modules/ngxs-root.module.js +44 -47
  147. package/esm5/src/operators/leave-ngxs.js +58 -58
  148. package/esm5/src/operators/of-action.js +217 -217
  149. package/esm5/src/plugin-manager.js +82 -82
  150. package/esm5/src/plugin_api.js +10 -10
  151. package/esm5/src/public_api.js +29 -29
  152. package/esm5/src/public_to_deprecate.js +64 -64
  153. package/esm5/src/state-token/state-token.js +57 -57
  154. package/esm5/src/state-token/symbols.js +5 -5
  155. package/esm5/src/store.js +241 -241
  156. package/esm5/src/symbols.js +230 -229
  157. package/esm5/src/utils/compose.js +55 -55
  158. package/esm5/src/utils/freeze.js +35 -35
  159. package/esm5/src/utils/selector-utils.js +230 -230
  160. package/esm5/src/utils/store-validators.js +78 -78
  161. package/esm5/src/utils/utils.js +151 -151
  162. package/fesm2015/ngxs-store-internals-testing.js +274 -274
  163. package/fesm2015/ngxs-store-internals-testing.js.map +1 -1
  164. package/fesm2015/ngxs-store-internals.js +175 -377
  165. package/fesm2015/ngxs-store-internals.js.map +1 -1
  166. package/fesm2015/ngxs-store-operators.js +312 -312
  167. package/fesm2015/ngxs-store-operators.js.map +1 -1
  168. package/fesm2015/ngxs-store.js +3915 -3995
  169. package/fesm2015/ngxs-store.js.map +1 -1
  170. package/fesm5/ngxs-store-internals-testing.js +321 -321
  171. package/fesm5/ngxs-store-internals-testing.js.map +1 -1
  172. package/fesm5/ngxs-store-internals.js +200 -402
  173. package/fesm5/ngxs-store-internals.js.map +1 -1
  174. package/fesm5/ngxs-store-operators.js +316 -316
  175. package/fesm5/ngxs-store-operators.js.map +1 -1
  176. package/fesm5/ngxs-store.js +4410 -4491
  177. package/fesm5/ngxs-store.js.map +1 -1
  178. package/index.d.ts +8 -8
  179. package/internals/angular.d.ts +1 -1
  180. package/internals/index.d.ts +6 -7
  181. package/internals/initial-state.d.ts +8 -8
  182. package/internals/internal-tokens.d.ts +9 -9
  183. package/internals/memoize.d.ts +9 -9
  184. package/internals/ngxs-bootstrapper.d.ts +13 -13
  185. package/internals/ngxs-store-internals.d.ts +4 -4
  186. package/internals/ngxs-store-internals.metadata.json +1 -1
  187. package/internals/src/symbols.d.ts +7 -7
  188. package/internals/symbols.d.ts +7 -7
  189. package/internals/testing/fresh-platform.d.ts +1 -1
  190. package/internals/testing/helpers/ngxs-test.component.d.ts +5 -5
  191. package/internals/testing/helpers/ngxs-test.module.d.ts +4 -4
  192. package/internals/testing/index.d.ts +4 -4
  193. package/internals/testing/ngxs-store-internals-testing.d.ts +4 -4
  194. package/internals/testing/ngxs.setup.d.ts +7 -7
  195. package/internals/testing/skip-console-logging.d.ts +1 -1
  196. package/internals/testing/symbol.d.ts +14 -14
  197. package/ngxs-store.d.ts +20 -19
  198. package/ngxs-store.metadata.json +1 -1
  199. package/operators/append.d.ts +6 -6
  200. package/operators/compose.d.ts +2 -2
  201. package/operators/iif.d.ts +11 -11
  202. package/operators/index.d.ts +13 -13
  203. package/operators/insert-item.d.ts +7 -7
  204. package/operators/internals.d.ts +2 -2
  205. package/operators/ngxs-store-operators.d.ts +4 -4
  206. package/operators/patch.d.ts +10 -10
  207. package/operators/remove-item.d.ts +7 -7
  208. package/operators/update-item.d.ts +10 -10
  209. package/operators/utils.d.ts +9 -9
  210. package/package.json +1 -1
  211. package/src/actions/actions.d.ts +15 -15
  212. package/src/actions/symbols.d.ts +21 -21
  213. package/src/actions-stream.d.ts +49 -49
  214. package/src/configs/messages.config.d.ts +11 -11
  215. package/src/decorators/action.d.ts +5 -5
  216. package/src/decorators/select/select-factory.d.ts +13 -13
  217. package/src/decorators/select/select.d.ts +4 -4
  218. package/src/decorators/select/symbols.d.ts +10 -14
  219. package/src/decorators/selector/selector.d.ts +5 -5
  220. package/src/decorators/selector/symbols.d.ts +4 -4
  221. package/src/decorators/selector-options.d.ts +5 -5
  222. package/src/decorators/state.d.ts +6 -6
  223. package/src/execution/dispatch-outside-zone-ngxs-execution-strategy.d.ts +11 -11
  224. package/src/execution/internal-ngxs-execution-strategy.d.ts +7 -7
  225. package/src/execution/noop-ngxs-execution-strategy.d.ts +5 -5
  226. package/src/execution/symbols.d.ts +10 -10
  227. package/src/internal/dispatcher.d.ts +32 -32
  228. package/src/internal/internals.d.ts +166 -166
  229. package/src/internal/lifecycle-state-manager.d.ts +20 -20
  230. package/src/internal/state-context-factory.d.ts +15 -15
  231. package/src/internal/state-factory.d.ts +57 -57
  232. package/src/internal/state-operations.d.ts +19 -19
  233. package/src/internal/state-operators.d.ts +2 -2
  234. package/src/internal/state-stream.d.ts +11 -11
  235. package/src/ivy/ivy-enabled-in-dev-mode.d.ts +6 -6
  236. package/src/module.d.ts +23 -23
  237. package/src/modules/ngxs-feature.module.d.ts +13 -13
  238. package/src/modules/ngxs-root.module.d.ts +13 -13
  239. package/src/operators/leave-ngxs.d.ts +7 -7
  240. package/src/operators/of-action.d.ts +43 -43
  241. package/src/plugin-manager.d.ts +10 -10
  242. package/src/plugin_api.d.ts +5 -5
  243. package/src/public_api.d.ts +17 -17
  244. package/src/public_to_deprecate.d.ts +21 -21
  245. package/src/state-token/state-token.d.ts +7 -7
  246. package/src/state-token/symbols.d.ts +5 -5
  247. package/src/store.d.ts +59 -59
  248. package/src/symbols.d.ts +139 -138
  249. package/src/utils/compose.d.ts +23 -23
  250. package/src/utils/freeze.d.ts +5 -5
  251. package/src/utils/selector-utils.d.ts +23 -23
  252. package/src/utils/store-validators.d.ts +7 -7
  253. package/src/utils/utils.d.ts +46 -46
  254. package/types/index.d.ts +2 -2
  255. package/esm2015/internals/decorator-injector-adapter.js +0 -204
  256. package/esm5/internals/decorator-injector-adapter.js +0 -204
  257. package/internals/decorator-injector-adapter.d.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals-testing.js","sources":["ng://@ngxs/store/internals/testing/helpers/ngxs-test.component.ts","ng://@ngxs/store/internals/testing/helpers/ngxs-test.module.ts","ng://@ngxs/store/internals/testing/ngxs.setup.ts","ng://@ngxs/store/internals/testing/fresh-platform.ts","ng://@ngxs/store/internals/testing/skip-console-logging.ts"],"sourcesContent":["import { AfterViewInit, Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n template: ''\r\n})\r\nexport class NgxsTestComponent implements OnInit, AfterViewInit {\r\n public ngOnInit(): void {}\r\n public ngAfterViewInit(): void {}\r\n}\r\n","import { ApplicationRef, NgModule } from '@angular/core';\r\nimport { BrowserModule } from '@angular/platform-browser';\r\n\r\nimport { NgxsTestComponent } from './ngxs-test.component';\r\n\r\n@NgModule({\r\n imports: [BrowserModule],\r\n declarations: [NgxsTestComponent],\r\n entryComponents: [NgxsTestComponent]\r\n})\r\nexport class NgxsTestModule {\r\n public static ngDoBootstrap(app: ApplicationRef): void {\r\n app.bootstrap(NgxsTestComponent);\r\n }\r\n}\r\n","import { ApplicationRef } from '@angular/core';\r\nimport { TestBed, TestBedStatic } from '@angular/core/testing';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { ɵBrowserDomAdapter as BrowserDomAdapter } from '@angular/platform-browser';\r\nimport {\r\n BrowserDynamicTestingModule,\r\n platformBrowserDynamicTesting\r\n} from '@angular/platform-browser-dynamic/testing';\r\nimport { NgxsModule, Store } from '@ngxs/store';\r\n\r\nimport { NgxsTestModule } from './helpers/ngxs-test.module';\r\nimport { NgxsOptionsTesting, NgxsTesting } from './symbol';\r\n\r\nexport class NgxsTestBed {\r\n public static configureTestingStates(options: NgxsOptionsTesting): NgxsTesting {\r\n this.resetTestBed();\r\n\r\n if (options.before) {\r\n options.before();\r\n }\r\n\r\n TestBed.configureTestingModule({\r\n imports: [\r\n NgxsTestModule,\r\n NgxsModule.forRoot(options.states || [], options.ngxsOptions || {}),\r\n ...(options.imports || [])\r\n ]\r\n }).compileComponents();\r\n\r\n NgxsTestBed.ngxsBootstrap();\r\n\r\n return {\r\n get store(): Store {\r\n return TestBed.inject(Store);\r\n },\r\n get getTestBed(): TestBedStatic {\r\n return TestBed;\r\n }\r\n };\r\n }\r\n\r\n private static ngxsBootstrap(): void {\r\n NgxsTestBed.createRootNode();\r\n NgxsTestModule.ngDoBootstrap(TestBed.inject(ApplicationRef));\r\n }\r\n\r\n private static resetTestBed(): void {\r\n TestBed.resetTestEnvironment();\r\n TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());\r\n }\r\n\r\n private static createRootNode(selector = 'app-root'): void {\r\n const document = TestBed.inject(DOCUMENT);\r\n const adapter = new BrowserDomAdapter();\r\n const root = adapter.createElement(selector);\r\n document.body.appendChild(root);\r\n }\r\n}\r\n","import { TestBed } from '@angular/core/testing';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { ɵgetDOM as getDOM } from '@angular/platform-browser';\r\nimport { VERSION, destroyPlatform, createPlatform } from '@angular/core';\r\n\r\nfunction createRootElement() {\r\n const document = TestBed.inject(DOCUMENT);\r\n const root = getDOM().createElement('app-root', document);\r\n document.body.appendChild(root);\r\n}\r\n\r\nfunction removeRootElement() {\r\n const root: Element = document.getElementsByTagName('app-root').item(0)!;\r\n try {\r\n document.body.removeChild(root);\r\n } catch {}\r\n}\r\n\r\nfunction destroyPlatformBeforeBootstrappingTheNewOne() {\r\n destroyPlatform();\r\n createRootElement();\r\n}\r\n\r\n// As we create our custom platform via `bootstrapModule`\r\n// we have to destroy it after assetions and revert\r\n// the previous one\r\nfunction resetPlatformAfterBootstrapping() {\r\n removeRootElement();\r\n destroyPlatform();\r\n const version = +VERSION.major;\r\n // https://github.com/angular/angular/commit/e250db4f261741b04ee4cbad4dec41a8908a12aa\r\n if (version < 14) {\r\n createPlatform(TestBed);\r\n }\r\n}\r\n\r\nexport function freshPlatform(fn: (done?: VoidFunction) => Promise<void>) {\r\n let resolve: VoidFunction | null = null;\r\n let reject: ((error: Error) => void) | null = null;\r\n let whenDoneIsCalledPromise: Promise<void> | null = null;\r\n\r\n const hasDoneArgument = fn.length === 1;\r\n\r\n if (hasDoneArgument) {\r\n whenDoneIsCalledPromise = new Promise<void>((_resolve, _reject) => {\r\n resolve = _resolve;\r\n reject = _reject;\r\n });\r\n }\r\n\r\n return async function testWithAFreshPlatform() {\r\n try {\r\n destroyPlatformBeforeBootstrappingTheNewOne();\r\n\r\n if (hasDoneArgument) {\r\n await fn((error?: Error) => {\r\n if (error) {\r\n reject!(error);\r\n } else {\r\n resolve!();\r\n }\r\n });\r\n await whenDoneIsCalledPromise!;\r\n } else {\r\n await fn();\r\n }\r\n } finally {\r\n resetPlatformAfterBootstrapping();\r\n }\r\n };\r\n}\r\n","/// <reference types=\"jest\" />\r\n\r\nexport function skipConsoleLogging<T extends (...args: any[]) => any>(fn: T): ReturnType<T> {\r\n const consoleSpies = [\r\n jest.spyOn(console, 'log').mockImplementation(() => {}),\r\n jest.spyOn(console, 'warn').mockImplementation(() => {}),\r\n jest.spyOn(console, 'error').mockImplementation(() => {}),\r\n jest.spyOn(console, 'info').mockImplementation(() => {})\r\n ];\r\n function restoreSpies() {\r\n consoleSpies.forEach(spy => spy.mockRestore());\r\n }\r\n let restoreSpyAsync = false;\r\n try {\r\n const returnValue = fn();\r\n if (returnValue instanceof Promise) {\r\n restoreSpyAsync = true;\r\n return returnValue.finally(() => restoreSpies()) as ReturnType<T>;\r\n }\r\n return returnValue;\r\n } finally {\r\n if (!restoreSpyAsync) {\r\n restoreSpies();\r\n }\r\n }\r\n}\r\n"],"names":["BrowserDomAdapter","getDOM"],"mappings":";;;;;;;;;;;;AAAA,AAEA;IAAA;KAOC;;;;IAFQ,oCAAQ;;;IAAf,eAA0B;;;;IACnB,2CAAe;;;IAAtB,eAAiC;;gBANlC,SAAS,SAAC;oBACT,QAAQ,EAAE,UAAU;oBACpB,QAAQ,EAAE,EAAE;iBACb;;IAID,wBAAC;CAPD,IAOC;;;;;;ACTD,AAKA;IAAA;KASC;;;;;IAHe,4BAAa;;;;IAA3B,UAA4B,GAAmB;QAC7C,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;KAClC;;gBARF,QAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,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AAY,EAAE,CAAC;SAChB;KACF;CACF;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ngxs-store-internals-testing.js","sources":["ng://@ngxs/store/internals/testing/helpers/ngxs-test.component.ts","ng://@ngxs/store/internals/testing/helpers/ngxs-test.module.ts","ng://@ngxs/store/internals/testing/ngxs.setup.ts","ng://@ngxs/store/internals/testing/fresh-platform.ts","ng://@ngxs/store/internals/testing/skip-console-logging.ts"],"sourcesContent":["import { AfterViewInit, Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-root',\n template: ''\n})\nexport class NgxsTestComponent implements OnInit, AfterViewInit {\n public ngOnInit(): void {}\n public ngAfterViewInit(): void {}\n}\n","import { ApplicationRef, NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\n\nimport { NgxsTestComponent } from './ngxs-test.component';\n\n@NgModule({\n imports: [BrowserModule],\n declarations: [NgxsTestComponent],\n entryComponents: [NgxsTestComponent]\n})\nexport class NgxsTestModule {\n public static ngDoBootstrap(app: ApplicationRef): void {\n app.bootstrap(NgxsTestComponent);\n }\n}\n","import { ApplicationRef } from '@angular/core';\nimport { TestBed, TestBedStatic } from '@angular/core/testing';\nimport { DOCUMENT } from '@angular/common';\nimport { ɵBrowserDomAdapter as BrowserDomAdapter } from '@angular/platform-browser';\nimport {\n BrowserDynamicTestingModule,\n platformBrowserDynamicTesting\n} from '@angular/platform-browser-dynamic/testing';\nimport { NgxsModule, Store } from '@ngxs/store';\n\nimport { NgxsTestModule } from './helpers/ngxs-test.module';\nimport { NgxsOptionsTesting, NgxsTesting } from './symbol';\n\nexport class NgxsTestBed {\n public static configureTestingStates(options: NgxsOptionsTesting): NgxsTesting {\n this.resetTestBed();\n\n if (options.before) {\n options.before();\n }\n\n TestBed.configureTestingModule({\n imports: [\n NgxsTestModule,\n NgxsModule.forRoot(options.states || [], options.ngxsOptions || {}),\n ...(options.imports || [])\n ]\n }).compileComponents();\n\n NgxsTestBed.ngxsBootstrap();\n\n return {\n get store(): Store {\n return TestBed.inject(Store);\n },\n get getTestBed(): TestBedStatic {\n return TestBed;\n }\n };\n }\n\n private static ngxsBootstrap(): void {\n NgxsTestBed.createRootNode();\n NgxsTestModule.ngDoBootstrap(TestBed.inject(ApplicationRef));\n }\n\n private static resetTestBed(): void {\n TestBed.resetTestEnvironment();\n TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());\n }\n\n private static createRootNode(selector = 'app-root'): void {\n const document = TestBed.inject(DOCUMENT);\n const adapter = new BrowserDomAdapter();\n const root = adapter.createElement(selector);\n document.body.appendChild(root);\n }\n}\n","import { TestBed } from '@angular/core/testing';\nimport { DOCUMENT } from '@angular/common';\nimport { ɵgetDOM as getDOM } from '@angular/platform-browser';\nimport { VERSION, destroyPlatform, createPlatform } from '@angular/core';\n\nfunction createRootElement() {\n const document = TestBed.inject(DOCUMENT);\n const root = getDOM().createElement('app-root', document);\n document.body.appendChild(root);\n}\n\nfunction removeRootElement() {\n const root: Element = document.getElementsByTagName('app-root').item(0)!;\n try {\n document.body.removeChild(root);\n } catch {}\n}\n\nfunction destroyPlatformBeforeBootstrappingTheNewOne() {\n destroyPlatform();\n createRootElement();\n}\n\n// As we create our custom platform via `bootstrapModule`\n// we have to destroy it after assetions and revert\n// the previous one\nfunction resetPlatformAfterBootstrapping() {\n removeRootElement();\n destroyPlatform();\n const version = +VERSION.major;\n // https://github.com/angular/angular/commit/e250db4f261741b04ee4cbad4dec41a8908a12aa\n if (version < 14) {\n createPlatform(TestBed);\n }\n}\n\nexport function freshPlatform(fn: (done?: VoidFunction) => Promise<void>) {\n let resolve: VoidFunction | null = null;\n let reject: ((error: Error) => void) | null = null;\n let whenDoneIsCalledPromise: Promise<void> | null = null;\n\n const hasDoneArgument = fn.length === 1;\n\n if (hasDoneArgument) {\n whenDoneIsCalledPromise = new Promise<void>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n }\n\n return async function testWithAFreshPlatform() {\n try {\n destroyPlatformBeforeBootstrappingTheNewOne();\n\n if (hasDoneArgument) {\n await fn((error?: Error) => {\n if (error) {\n reject!(error);\n } else {\n resolve!();\n }\n });\n await whenDoneIsCalledPromise!;\n } else {\n await fn();\n }\n } finally {\n resetPlatformAfterBootstrapping();\n }\n };\n}\n","/// <reference types=\"jest\" />\n\nexport function skipConsoleLogging<T extends (...args: any[]) => any>(fn: T): ReturnType<T> {\n const consoleSpies = [\n jest.spyOn(console, 'log').mockImplementation(() => {}),\n jest.spyOn(console, 'warn').mockImplementation(() => {}),\n jest.spyOn(console, 'error').mockImplementation(() => {}),\n jest.spyOn(console, 'info').mockImplementation(() => {})\n ];\n function restoreSpies() {\n consoleSpies.forEach(spy => spy.mockRestore());\n }\n let restoreSpyAsync = false;\n try {\n const returnValue = fn();\n if (returnValue instanceof Promise) {\n restoreSpyAsync = true;\n return returnValue.finally(() => restoreSpies()) as ReturnType<T>;\n }\n return returnValue;\n } finally {\n if (!restoreSpyAsync) {\n restoreSpies();\n }\n }\n}\n"],"names":["BrowserDomAdapter","getDOM"],"mappings":";;;;;;;;;;;;AAAA,AAEA;IAAA;KAOC;;;;IAFQ,oCAAQ;;;IAAf,eAA0B;;;;IACnB,2CAAe;;;IAAtB,eAAiC;;gBANlC,SAAS,SAAC;oBACT,QAAQ,EAAE,UAAU;oBACpB,QAAQ,EAAE,EAAE;iBACb;;IAID,wBAAC;CAPD,IAOC;;;;;;ACTD,AAKA;IAAA;KASC;;;;;IAHe,4BAAa;;;;IAA3B,UAA4B,GAAmB;QAC7C,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;KAClC;;gBARF,QAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,eAAe,EAAE,CAAC,iBAAiB,CAAC;iBACrC;;IAKD,qBAAC;CATD,IASC;;;;;;;ICDD;KA4CC;;;;;IA3Ce,kCAAsB;;;;IAApC,UAAqC,OAA2B;QA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';
1
+ import { 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
- * @return {?}
10
- */
11
- function isAngularInTestMode() {
12
- // This is safe to check for these properties in the following way since `typeof` does not
13
- // throw an exception if the value does not exist in the scope.
14
- // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).
15
- // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into
16
- // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.
17
- // this will return undefined `global.jest`, but `jest` will not equal undefined.
18
- return (typeof __karma__ !== 'undefined' ||
19
- typeof jasmine !== 'undefined' ||
20
- typeof jest !== 'undefined' ||
21
- typeof Mocha !== 'undefined');
4
+ /**
5
+ * @fileoverview added by tsickle
6
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7
+ */
8
+ /**
9
+ * @return {?}
10
+ */
11
+ function isAngularInTestMode() {
12
+ // This is safe to check for these properties in the following way since `typeof` does not
13
+ // throw an exception if the value does not exist in the scope.
14
+ // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).
15
+ // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into
16
+ // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.
17
+ // this will return undefined `global.jest`, but `jest` will not equal undefined.
18
+ return (typeof __karma__ !== 'undefined' ||
19
+ typeof jasmine !== 'undefined' ||
20
+ typeof jest !== 'undefined' ||
21
+ typeof Mocha !== 'undefined');
22
22
  }
23
23
 
24
- /**
25
- * @fileoverview added by tsickle
26
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
27
- */
28
- var NgxsBootstrapper = /** @class */ (function () {
29
- function NgxsBootstrapper() {
30
- /**
31
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
32
- */
33
- this.bootstrap$ = new ReplaySubject(1);
34
- }
35
- Object.defineProperty(NgxsBootstrapper.prototype, "appBootstrapped$", {
36
- get: /**
37
- * @return {?}
38
- */
39
- function () {
40
- return this.bootstrap$.asObservable();
41
- },
42
- enumerable: true,
43
- configurable: true
44
- });
45
- /**
46
- * This event will be emitted after attaching `ComponentRef` of the root component
47
- * to the tree of views, that's a signal that application has been fully rendered
48
- */
49
- /**
50
- * This event will be emitted after attaching `ComponentRef` of the root component
51
- * to the tree of views, that's a signal that application has been fully rendered
52
- * @return {?}
53
- */
54
- NgxsBootstrapper.prototype.bootstrap = /**
55
- * This event will be emitted after attaching `ComponentRef` of the root component
56
- * to the tree of views, that's a signal that application has been fully rendered
57
- * @return {?}
58
- */
59
- function () {
60
- this.bootstrap$.next(true);
61
- this.bootstrap$.complete();
62
- };
63
- NgxsBootstrapper.decorators = [
64
- { type: Injectable }
65
- ];
66
- return NgxsBootstrapper;
67
- }());
68
- if (false) {
69
- /**
70
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
71
- * @type {?}
72
- * @private
73
- */
74
- NgxsBootstrapper.prototype.bootstrap$;
24
+ /**
25
+ * @fileoverview added by tsickle
26
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
27
+ */
28
+ var NgxsBootstrapper = /** @class */ (function () {
29
+ function NgxsBootstrapper() {
30
+ /**
31
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
32
+ */
33
+ this.bootstrap$ = new ReplaySubject(1);
34
+ }
35
+ Object.defineProperty(NgxsBootstrapper.prototype, "appBootstrapped$", {
36
+ get: /**
37
+ * @return {?}
38
+ */
39
+ function () {
40
+ return this.bootstrap$.asObservable();
41
+ },
42
+ enumerable: true,
43
+ configurable: true
44
+ });
45
+ /**
46
+ * This event will be emitted after attaching `ComponentRef` of the root component
47
+ * to the tree of views, that's a signal that application has been fully rendered
48
+ */
49
+ /**
50
+ * This event will be emitted after attaching `ComponentRef` of the root component
51
+ * to the tree of views, that's a signal that application has been fully rendered
52
+ * @return {?}
53
+ */
54
+ NgxsBootstrapper.prototype.bootstrap = /**
55
+ * This event will be emitted after attaching `ComponentRef` of the root component
56
+ * to the tree of views, that's a signal that application has been fully rendered
57
+ * @return {?}
58
+ */
59
+ function () {
60
+ this.bootstrap$.next(true);
61
+ this.bootstrap$.complete();
62
+ };
63
+ NgxsBootstrapper.decorators = [
64
+ { type: Injectable }
65
+ ];
66
+ return NgxsBootstrapper;
67
+ }());
68
+ if (false) {
69
+ /**
70
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
71
+ * @type {?}
72
+ * @private
73
+ */
74
+ NgxsBootstrapper.prototype.bootstrap$;
75
75
  }
76
76
 
77
- /**
78
- * @fileoverview added by tsickle
79
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
80
- */
81
- /**
82
- * @param {?} a
83
- * @param {?} b
84
- * @return {?}
85
- */
86
- function defaultEqualityCheck(a, b) {
87
- return a === b;
88
- }
89
- /**
90
- * @param {?} equalityCheck
91
- * @param {?} prev
92
- * @param {?} next
93
- * @return {?}
94
- */
95
- function areArgumentsShallowlyEqual(equalityCheck, prev, next) {
96
- if (prev === null || next === null || prev.length !== next.length) {
97
- return false;
98
- }
99
- // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
100
- /** @type {?} */
101
- var length = prev.length;
102
- for (var i = 0; i < length; i++) {
103
- if (!equalityCheck(prev[i], next[i])) {
104
- return false;
105
- }
106
- }
107
- return true;
108
- }
109
- /**
110
- * Memoize a function on its last inputs only.
111
- * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js
112
- *
113
- * @ignore
114
- * @template T
115
- * @param {?} func
116
- * @param {?=} equalityCheck
117
- * @return {?}
118
- */
119
- function memoize(func, equalityCheck) {
120
- if (equalityCheck === void 0) { equalityCheck = defaultEqualityCheck; }
121
- /** @type {?} */
122
- var lastArgs = null;
123
- /** @type {?} */
124
- var lastResult = null;
125
- // we reference arguments instead of spreading them for performance reasons
126
- /**
127
- * @return {?}
128
- */
129
- function memoized() {
130
- if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {
131
- // apply arguments instead of spreading for performance.
132
- lastResult = ((/** @type {?} */ (func))).apply(null, arguments);
133
- }
134
- lastArgs = arguments;
135
- return lastResult;
136
- }
137
- ((/** @type {?} */ (memoized))).reset = (/**
138
- * @return {?}
139
- */
140
- function () {
141
- // The hidden (for now) ability to reset the memoization
142
- lastArgs = null;
143
- lastResult = null;
144
- });
145
- return (/** @type {?} */ (memoized));
77
+ /**
78
+ * @fileoverview added by tsickle
79
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
80
+ */
81
+ /**
82
+ * @param {?} a
83
+ * @param {?} b
84
+ * @return {?}
85
+ */
86
+ function defaultEqualityCheck(a, b) {
87
+ return a === b;
88
+ }
89
+ /**
90
+ * @param {?} equalityCheck
91
+ * @param {?} prev
92
+ * @param {?} next
93
+ * @return {?}
94
+ */
95
+ function areArgumentsShallowlyEqual(equalityCheck, prev, next) {
96
+ if (prev === null || next === null || prev.length !== next.length) {
97
+ return false;
98
+ }
99
+ // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
100
+ /** @type {?} */
101
+ var length = prev.length;
102
+ for (var i = 0; i < length; i++) {
103
+ if (!equalityCheck(prev[i], next[i])) {
104
+ return false;
105
+ }
106
+ }
107
+ return true;
108
+ }
109
+ /**
110
+ * Memoize a function on its last inputs only.
111
+ * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js
112
+ *
113
+ * @ignore
114
+ * @template T
115
+ * @param {?} func
116
+ * @param {?=} equalityCheck
117
+ * @return {?}
118
+ */
119
+ function memoize(func, equalityCheck) {
120
+ if (equalityCheck === void 0) { equalityCheck = defaultEqualityCheck; }
121
+ /** @type {?} */
122
+ var lastArgs = null;
123
+ /** @type {?} */
124
+ var lastResult = null;
125
+ // we reference arguments instead of spreading them for performance reasons
126
+ /**
127
+ * @return {?}
128
+ */
129
+ function memoized() {
130
+ if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {
131
+ // apply arguments instead of spreading for performance.
132
+ lastResult = ((/** @type {?} */ (func))).apply(null, arguments);
133
+ }
134
+ lastArgs = arguments;
135
+ return lastResult;
136
+ }
137
+ ((/** @type {?} */ (memoized))).reset = (/**
138
+ * @return {?}
139
+ */
140
+ function () {
141
+ // The hidden (for now) ability to reset the memoization
142
+ lastArgs = null;
143
+ lastResult = null;
144
+ });
145
+ return (/** @type {?} */ (memoized));
146
146
  }
147
147
 
148
- /**
149
- * @fileoverview added by tsickle
150
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
151
- */
152
- /** @type {?} */
153
- var INITIAL_STATE_TOKEN = new InjectionToken('INITIAL_STATE_TOKEN');
154
- var InitialState = /** @class */ (function () {
155
- function InitialState() {
156
- }
157
- /**
158
- * @param {?} state
159
- * @return {?}
160
- */
161
- InitialState.set = /**
162
- * @param {?} state
163
- * @return {?}
164
- */
165
- function (state) {
166
- this.value = state;
167
- };
168
- /**
169
- * @return {?}
170
- */
171
- InitialState.pop = /**
172
- * @return {?}
173
- */
174
- function () {
175
- /** @type {?} */
176
- var state = this.value;
177
- this.value = {};
178
- return state;
179
- };
180
- InitialState.value = {};
181
- return InitialState;
182
- }());
183
- if (false) {
184
- /**
185
- * @type {?}
186
- * @private
187
- */
188
- InitialState.value;
148
+ /**
149
+ * @fileoverview added by tsickle
150
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
151
+ */
152
+ /** @type {?} */
153
+ var INITIAL_STATE_TOKEN = new InjectionToken('INITIAL_STATE_TOKEN');
154
+ var InitialState = /** @class */ (function () {
155
+ function InitialState() {
156
+ }
157
+ /**
158
+ * @param {?} state
159
+ * @return {?}
160
+ */
161
+ InitialState.set = /**
162
+ * @param {?} state
163
+ * @return {?}
164
+ */
165
+ function (state) {
166
+ this.value = state;
167
+ };
168
+ /**
169
+ * @return {?}
170
+ */
171
+ InitialState.pop = /**
172
+ * @return {?}
173
+ */
174
+ function () {
175
+ /** @type {?} */
176
+ var state = this.value;
177
+ this.value = {};
178
+ return state;
179
+ };
180
+ InitialState.value = {};
181
+ return InitialState;
182
+ }());
183
+ if (false) {
184
+ /**
185
+ * @type {?}
186
+ * @private
187
+ */
188
+ InitialState.value;
189
189
  }
190
190
 
191
- /**
192
- * @fileoverview added by tsickle
193
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
194
- */
195
- /**
196
- * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally
197
- * @type {?}
198
- */
199
- var NGXS_STATE_CONTEXT_FACTORY = new InjectionToken('Internals.StateContextFactory');
200
- /**
201
- * @see StateFactory as it's referenced by this token to be accessed by plugins internally
202
- * @type {?}
203
- */
191
+ /**
192
+ * @fileoverview added by tsickle
193
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
194
+ */
195
+ /**
196
+ * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally
197
+ * @type {?}
198
+ */
199
+ var NGXS_STATE_CONTEXT_FACTORY = new InjectionToken('Internals.StateContextFactory');
200
+ /**
201
+ * @see StateFactory as it's referenced by this token to be accessed by plugins internally
202
+ * @type {?}
203
+ */
204
204
  var NGXS_STATE_FACTORY = new InjectionToken('Internals.StateFactory');
205
205
 
206
- /**
207
- * @fileoverview added by tsickle
208
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
209
- */
210
- // Angular doesn't export `NG_FACTORY_DEF`.
211
- /** @type {?} */
212
- var NG_FACTORY_DEF = 'ɵfac';
213
- // A `Symbol` which is used to save the `Injector` onto the class instance.
214
- /** @type {?} */
215
- var InjectorInstance = Symbol('InjectorInstance');
216
- // A `Symbol` which is used to determine if factory has been decorated previously or not.
217
- /** @type {?} */
218
- var FactoryHasBeenDecorated = Symbol('FactoryHasBeenDecorated');
219
- // A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot
220
- // be retrieved within the `constructor` since it's set after the `factory()` is called.
221
- /** @type {?} */
222
- var InjectorNotifier = Symbol('InjectorNotifier');
223
- /**
224
- * @record
225
- */
226
- function PrototypeWithInjectorNotifier() { }
227
- if (false) {
228
- /* Skipping unnamed member:
229
- [InjectorNotifier]?: ReplaySubject<boolean>;*/
230
- }
231
- /**
232
- * @param {?} target
233
- * @return {?}
234
- */
235
- function ensureInjectorNotifierIsCaptured(target) {
236
- if (target[InjectorNotifier]) {
237
- return (/** @type {?} */ (target[InjectorNotifier]));
238
- }
239
- else {
240
- /** @type {?} */
241
- var injectorNotifier$_1 = new ReplaySubject(1);
242
- Object.defineProperty(target, InjectorNotifier, {
243
- get: (/**
244
- * @return {?}
245
- */
246
- function () { return injectorNotifier$_1; })
247
- });
248
- return injectorNotifier$_1;
249
- }
250
- }
251
- // eslint-disable-next-line @typescript-eslint/ban-types
252
- /**
253
- * @param {?} target
254
- * @return {?}
255
- */
256
- function ensureLocalInjectorCaptured(target) {
257
- if (FactoryHasBeenDecorated in target.constructor.prototype) {
258
- return;
259
- }
260
- /** @type {?} */
261
- var constructor = target.constructor;
262
- // Means we're in AOT mode.
263
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
264
- decorateFactory(constructor);
265
- }
266
- else if (ngDevMode) {
267
- // We're running in JIT mode and that means we're not able to get the compiled definition
268
- // on the class inside the property decorator during the current message loop tick. We have
269
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
270
- // resolved even before the `APP_INITIALIZER` is resolved.
271
- // The below code also will be executed only in development mode, since it's never recommended
272
- // to use the JIT compiler in production mode (by setting "aot: false").
273
- decorateFactoryLater(constructor);
274
- }
275
- target.constructor.prototype[FactoryHasBeenDecorated] = true;
276
- }
277
- /**
278
- * @template T
279
- * @param {?} instance
280
- * @param {?} token
281
- * @return {?}
282
- */
283
- function localInject(instance, token) {
284
- /** @type {?} */
285
- var injector = instance[InjectorInstance];
286
- return injector ? injector.get(token) : null;
287
- }
288
- /**
289
- * @param {?} constructor
290
- * @return {?}
291
- */
292
- function decorateFactory(constructor) {
293
- /** @type {?} */
294
- var factory = constructor[NG_FACTORY_DEF];
295
- if (typeof factory !== 'function') {
296
- return;
297
- }
298
- // Let's try to get any definition.
299
- // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first
300
- // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).
301
- /** @type {?} */
302
- var def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;
303
- /** @type {?} */
304
- var decoratedFactory = (/**
305
- * @return {?}
306
- */
307
- function () {
308
- /** @type {?} */
309
- var instance = factory();
310
- // Caretaker note: `inject()` won't work here.
311
- // We can use the `directiveInject` only during the component
312
- // construction, since Angular captures the currently active injector.
313
- // We're not able to use this function inside the getter (when the `selectorId` property is
314
- // requested for the first time), since the currently active injector will be null.
315
- instance[InjectorInstance] = ɵɵdirectiveInject(
316
- // We're using `INJECTOR` token except of the `Injector` class since the compiler
317
- // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.
318
- // Caretaker note: that this is the same way of getting the injector.
319
- INJECTOR);
320
- // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.
321
- /** @type {?} */
322
- var injectorNotifier$ = instance[InjectorNotifier];
323
- if (injectorNotifier$) {
324
- injectorNotifier$.next(true);
325
- injectorNotifier$.complete();
326
- }
327
- return instance;
328
- });
329
- // If we've found any definition then it's enough to override the `def.factory` since Angular
330
- // code uses the `def.factory` and then fallbacks to `ɵfac`.
331
- if (def) {
332
- def.factory = decoratedFactory;
333
- }
334
- // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular
335
- // still uses the `ɵfac`.
336
- Object.defineProperty(constructor, NG_FACTORY_DEF, {
337
- get: (/**
338
- * @return {?}
339
- */
340
- function () { return decoratedFactory; })
341
- });
342
- }
343
- /**
344
- * @param {?} constructor
345
- * @return {?}
346
- */
347
- function decorateFactoryLater(constructor) {
348
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
349
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
350
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
351
- // Promise.then from within a sync test`.
352
- try {
353
- Promise.resolve().then((/**
354
- * @return {?}
355
- */
356
- function () {
357
- decorateFactory(constructor);
358
- }));
359
- }
360
- catch (_a) {
361
- // This is kind of a "hack", but we try to be backwards-compatible,
362
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
363
- ɵglobal.process &&
364
- ɵglobal.process.nextTick &&
365
- ɵglobal.process.nextTick((/**
366
- * @return {?}
367
- */
368
- function () {
369
- decorateFactory(constructor);
370
- }));
371
- }
372
- }
373
- /**
374
- * @record
375
- */
376
- function Definition() { }
377
- if (false) {
378
- /** @type {?} */
379
- Definition.prototype.factory;
380
- }
381
- /**
382
- * @record
383
- */
384
- function ConstructorWithDefinitionAndFactory() { }
385
- if (false) {
386
- /** @type {?|undefined} */
387
- ConstructorWithDefinitionAndFactory.prototype.ɵprov;
388
- /** @type {?|undefined} */
389
- ConstructorWithDefinitionAndFactory.prototype.ɵpipe;
390
- /** @type {?|undefined} */
391
- ConstructorWithDefinitionAndFactory.prototype.ɵcmp;
392
- /** @type {?|undefined} */
393
- ConstructorWithDefinitionAndFactory.prototype.ɵdir;
394
- /* Skipping unnamed member:
395
- [NG_FACTORY_DEF]?: Factory;*/
396
- }
397
- /**
398
- * @record
399
- */
400
- function PrivateInstance() { }
401
- if (false) {
402
- /* Skipping unnamed member:
403
- [InjectorInstance]?: Injector;*/
404
- /* Skipping unnamed member:
405
- [InjectorNotifier]?: ReplaySubject<boolean>;*/
406
- }
407
-
408
- /**
409
- * @fileoverview added by tsickle
410
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
206
+ /**
207
+ * @fileoverview added by tsickle
208
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
411
209
  */
412
210
 
413
- /**
414
- * @fileoverview added by tsickle
415
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
211
+ /**
212
+ * @fileoverview added by tsickle
213
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
416
214
  */
417
215
 
418
- export { INITIAL_STATE_TOKEN, InitialState, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, NgxsBootstrapper, ensureInjectorNotifierIsCaptured, ensureLocalInjectorCaptured, isAngularInTestMode, localInject, memoize };
216
+ export { INITIAL_STATE_TOKEN, InitialState, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, NgxsBootstrapper, isAngularInTestMode, memoize };
419
217
  //# sourceMappingURL=ngxs-store-internals.js.map