@ngxs/store 3.8.2 → 18.0.0-dev.master-f4c2c19
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.
- package/README.md +1 -1
- package/{esm2015/index.js → esm2022/index.mjs} +2 -2
- package/esm2022/internals/custom-rxjs-subjects.mjs +92 -0
- package/esm2022/internals/index.mjs +10 -0
- package/esm2022/internals/initial-state.mjs +18 -0
- package/esm2022/internals/internal-tokens.mjs +6 -0
- package/esm2022/internals/memoize.mjs +45 -0
- package/esm2022/internals/metadata.mjs +57 -0
- package/esm2022/internals/ngxs-app-bootstrapped-state.mjs +19 -0
- package/esm2022/internals/state-stream.mjs +32 -0
- package/esm2022/internals/state-token.mjs +17 -0
- package/esm2022/internals/symbols.mjs +11 -0
- package/esm2022/internals/testing/fresh-platform.mjs +72 -0
- package/{esm2015/internals/testing/helpers/ngxs-test.component.js → esm2022/internals/testing/helpers/ngxs-test.component.mjs} +4 -4
- package/esm2022/internals/testing/helpers/ngxs-test.module.mjs +20 -0
- package/{esm2015/internals/testing/index.js → esm2022/internals/testing/index.mjs} +2 -2
- package/esm2022/internals/testing/ngxs.setup.mjs +48 -0
- package/{esm2015/internals/testing/skip-console-logging.js → esm2022/internals/testing/skip-console-logging.mjs} +1 -1
- package/esm2022/internals/testing/symbol.mjs +2 -0
- package/esm2022/operators/append.mjs +20 -0
- package/esm2022/operators/iif.mjs +38 -0
- package/esm2022/operators/insert-item.mjs +29 -0
- package/esm2022/operators/patch.mjs +21 -0
- package/esm2022/operators/remove-item.mjs +22 -0
- package/esm2022/operators/update-item.mjs +40 -0
- package/esm2022/plugins/actions.mjs +16 -0
- package/esm2022/plugins/index.mjs +4 -0
- package/esm2022/plugins/ngxs-store-plugins.mjs +5 -0
- package/esm2022/plugins/symbols.mjs +6 -0
- package/esm2022/plugins/utils.mjs +51 -0
- package/esm2022/src/actions/symbols.mjs +2 -0
- package/esm2022/src/actions-stream.mjs +52 -0
- package/esm2022/src/configs/messages.config.mjs +48 -0
- package/esm2022/src/decorators/action.mjs +31 -0
- package/esm2022/src/decorators/select/select-factory.mjs +29 -0
- package/esm2022/src/decorators/select/select.mjs +29 -0
- package/esm2022/src/decorators/select/symbols.mjs +29 -0
- package/esm2022/src/decorators/selector/selector.mjs +29 -0
- package/esm2022/src/decorators/selector/symbols.mjs +2 -0
- package/esm2022/src/decorators/selector-options.mjs +21 -0
- package/esm2022/src/decorators/state.mjs +35 -0
- package/esm2022/src/dev-features/ngxs-development.module.mjs +28 -0
- package/esm2022/src/dev-features/ngxs-unhandled-actions-logger.mjs +45 -0
- package/esm2022/src/dev-features/symbols.mjs +7 -0
- package/esm2022/src/execution/dispatch-outside-zone-ngxs-execution-strategy.mjs +55 -0
- package/{esm2015/src/execution/internal-ngxs-execution-strategy.js → esm2022/src/execution/internal-ngxs-execution-strategy.mjs} +6 -6
- package/{esm2015/src/execution/noop-ngxs-execution-strategy.js → esm2022/src/execution/noop-ngxs-execution-strategy.mjs} +4 -4
- package/esm2022/src/execution/symbols.mjs +29 -0
- package/esm2022/src/internal/dispatcher.mjs +106 -0
- package/esm2022/src/internal/fallback-subscriber.mjs +29 -0
- package/esm2022/src/internal/internals.mjs +206 -0
- package/esm2022/src/internal/lifecycle-state-manager.mjs +86 -0
- package/esm2022/src/internal/state-context-factory.mjs +71 -0
- package/esm2022/src/internal/state-factory.mjs +311 -0
- package/esm2022/src/internal/state-operations.mjs +63 -0
- package/esm2022/src/internal/state-operators.mjs +20 -0
- package/esm2022/src/internal/unhandled-rxjs-error-callback.mjs +39 -0
- package/esm2022/src/ivy/ivy-enabled-in-dev-mode.mjs +25 -0
- package/esm2022/src/module.mjs +27 -0
- package/esm2022/src/modules/ngxs-feature.module.mjs +18 -0
- package/esm2022/src/modules/ngxs-root.module.mjs +18 -0
- package/esm2022/src/ngxs-unhandled-error-handler.mjs +29 -0
- package/esm2022/src/operators/of-action.mjs +104 -0
- package/esm2022/src/plugin-manager.mjs +37 -0
- package/esm2022/src/plugin_api.mjs +2 -0
- package/{esm2015/src/private_api.js → esm2022/src/private_api.mjs} +2 -1
- package/esm2022/src/public_api.mjs +20 -0
- package/esm2022/src/selectors/create-model-selector.mjs +30 -0
- package/esm2022/src/selectors/create-pick-selector.mjs +16 -0
- package/esm2022/src/selectors/create-property-selectors.mjs +20 -0
- package/esm2022/src/selectors/create-selector.mjs +9 -0
- package/esm2022/src/selectors/private_api.mjs +2 -0
- package/esm2022/src/selectors/selector-checks.util.mjs +18 -0
- package/esm2022/src/selectors/selector-metadata.mjs +35 -0
- package/esm2022/src/selectors/selector-models.mjs +2 -0
- package/esm2022/src/selectors/selector-types.util.mjs +2 -0
- package/esm2022/src/selectors/selector-utils.mjs +95 -0
- package/esm2022/src/standalone-features/feature-providers.mjs +20 -0
- package/esm2022/src/standalone-features/index.mjs +5 -0
- package/esm2022/src/standalone-features/initializers.mjs +89 -0
- package/esm2022/src/standalone-features/plugin.mjs +20 -0
- package/esm2022/src/standalone-features/preboot.mjs +32 -0
- package/esm2022/src/standalone-features/provide-states.mjs +26 -0
- package/esm2022/src/standalone-features/provide-store.mjs +26 -0
- package/esm2022/src/standalone-features/root-providers.mjs +47 -0
- package/esm2022/src/store.mjs +117 -0
- package/esm2022/src/symbols.mjs +87 -0
- package/esm2022/src/utils/compose.mjs +26 -0
- package/esm2022/src/utils/create-dispatch-map.mjs +11 -0
- package/esm2022/src/utils/create-select-map.mjs +13 -0
- package/esm2022/src/utils/dispatch.mjs +7 -0
- package/{esm2015/src/utils/freeze.js → esm2022/src/utils/freeze.mjs} +1 -1
- package/esm2022/src/utils/public_api.mjs +5 -0
- package/esm2022/src/utils/select.mjs +19 -0
- package/esm2022/src/utils/store-validators.mjs +25 -0
- package/{fesm2015/ngxs-store-internals-testing.js → fesm2022/ngxs-store-internals-testing.mjs} +84 -81
- package/fesm2022/ngxs-store-internals-testing.mjs.map +1 -0
- package/fesm2022/ngxs-store-internals.mjs +296 -0
- package/fesm2022/ngxs-store-internals.mjs.map +1 -0
- package/{fesm2015/ngxs-store-operators.js → fesm2022/ngxs-store-operators.mjs} +3 -3
- package/fesm2022/ngxs-store-operators.mjs.map +1 -0
- package/fesm2022/ngxs-store-plugins.mjs +80 -0
- package/fesm2022/ngxs-store-plugins.mjs.map +1 -0
- package/{fesm2015/ngxs-store.js → fesm2022/ngxs-store.mjs} +1319 -1265
- package/fesm2022/ngxs-store.mjs.map +1 -0
- package/index.d.ts +1 -1
- package/{src/internal → internals}/custom-rxjs-subjects.d.ts +2 -2
- package/internals/index.d.ts +8 -4
- package/internals/initial-state.d.ts +5 -5
- package/internals/memoize.d.ts +1 -1
- package/internals/metadata.d.ts +25 -0
- package/internals/ngxs-app-bootstrapped-state.d.ts +8 -0
- package/internals/state-stream.d.ts +15 -0
- package/internals/state-token.d.ts +7 -0
- package/internals/symbols.d.ts +84 -3
- package/internals/testing/helpers/ngxs-test.component.d.ts +1 -1
- package/internals/testing/index.d.ts +2 -2
- package/internals/testing/symbol.d.ts +2 -2
- package/operators/patch.d.ts +2 -2
- package/operators/types.d.ts +5 -5
- package/operators/utils.d.ts +1 -1
- package/package.json +44 -13
- package/{src/actions → plugins}/actions.d.ts +3 -3
- package/plugins/index.d.ts +3 -0
- package/plugins/symbols.d.ts +13 -0
- package/{src/utils → plugins}/utils.d.ts +0 -17
- package/schematics/collection.json +36 -0
- package/schematics/src/actions/actions.factory.d.ts +3 -0
- package/schematics/src/actions/actions.factory.js +24 -0
- package/schematics/src/actions/actions.factory.js.map +1 -0
- package/schematics/src/actions/files/__name__.actions.ts__template__ +4 -0
- package/schematics/src/actions/schema.json +35 -0
- package/schematics/src/ng-add/add-declaration.d.ts +4 -0
- package/schematics/src/ng-add/add-declaration.js +109 -0
- package/schematics/src/ng-add/add-declaration.js.map +1 -0
- package/schematics/src/ng-add/ng-add.factory.d.ts +9 -0
- package/schematics/src/ng-add/ng-add.factory.js +89 -0
- package/schematics/src/ng-add/ng-add.factory.js.map +1 -0
- package/schematics/src/ng-add/schema.json +72 -0
- package/schematics/src/starter-kit/files/store/auth/auth.actions.ts__template__ +6 -0
- package/schematics/src/starter-kit/files/store/auth/auth.state.spec.ts__template__ +55 -0
- package/schematics/src/starter-kit/files/store/auth/auth.state.ts__template__ +47 -0
- package/schematics/src/starter-kit/files/store/dashboard/index.ts__template__ +4 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.actions.ts__template__ +10 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.spec.ts__template__ +92 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.ts__template__ +62 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.actions.ts__template__ +6 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.spec.ts__template__ +61 -0
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.ts__template__ +42 -0
- package/schematics/src/starter-kit/files/store/store.config.ts__template__ +39 -0
- package/schematics/src/starter-kit/files/store/store.module.ts__template__ +22 -0
- package/schematics/src/starter-kit/schema.json +22 -0
- package/schematics/src/starter-kit/starter-kit.factory.d.ts +3 -0
- package/schematics/src/starter-kit/starter-kit.factory.js +21 -0
- package/schematics/src/starter-kit/starter-kit.factory.js.map +1 -0
- package/schematics/src/state/files/__name__.state.spec.ts__template__ +25 -0
- package/schematics/src/state/files/__name__.state.ts__template__ +22 -0
- package/schematics/src/state/schema.json +44 -0
- package/schematics/src/state/state.factory.d.ts +3 -0
- package/schematics/src/state/state.factory.js +29 -0
- package/schematics/src/state/state.factory.js.map +1 -0
- package/schematics/src/store/files/__name__.actions.ts__template__ +4 -0
- package/schematics/src/store/files/__name__.state.spec.ts__template__ +26 -0
- package/schematics/src/store/files/__name__.state.ts__template__ +29 -0
- package/schematics/src/store/schema.json +44 -0
- package/schematics/src/store/store.factory.d.ts +3 -0
- package/schematics/src/store/store.factory.js +29 -0
- package/schematics/src/store/store.factory.js.map +1 -0
- package/schematics/src/utils/common/lib.config.d.ts +10 -0
- package/schematics/src/utils/common/lib.config.js +15 -0
- package/schematics/src/utils/common/lib.config.js.map +1 -0
- package/schematics/src/utils/common/project-files.config.d.ts +3 -0
- package/schematics/src/utils/common/project-files.config.js +7 -0
- package/schematics/src/utils/common/project-files.config.js.map +1 -0
- package/schematics/src/utils/common/properties.d.ts +1 -0
- package/schematics/src/utils/common/properties.js +8 -0
- package/schematics/src/utils/common/properties.js.map +1 -0
- package/schematics/src/utils/config.d.ts +119 -0
- package/schematics/src/utils/config.js +21 -0
- package/schematics/src/utils/config.js.map +1 -0
- package/schematics/src/utils/generate-utils.d.ts +4 -0
- package/schematics/src/utils/generate-utils.js +14 -0
- package/schematics/src/utils/generate-utils.js.map +1 -0
- package/schematics/src/utils/interfaces/package.interface.d.ts +7 -0
- package/schematics/src/utils/interfaces/package.interface.js +3 -0
- package/schematics/src/utils/interfaces/package.interface.js.map +1 -0
- package/schematics/src/utils/ng-utils/README.md +1 -0
- package/schematics/src/utils/ng-utils/ast-utils.d.ts +99 -0
- package/schematics/src/utils/ng-utils/ast-utils.js +517 -0
- package/schematics/src/utils/ng-utils/ast-utils.js.map +1 -0
- package/schematics/src/utils/ng-utils/ng-ast-utils.d.ts +5 -0
- package/schematics/src/utils/ng-utils/ng-ast-utils.js +67 -0
- package/schematics/src/utils/ng-utils/ng-ast-utils.js.map +1 -0
- package/schematics/src/utils/ng-utils/project.d.ts +2 -0
- package/schematics/src/utils/ng-utils/project.js +27 -0
- package/schematics/src/utils/ng-utils/project.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/app_config.d.ts +16 -0
- package/schematics/src/utils/ng-utils/standalone/app_config.js +84 -0
- package/schematics/src/utils/ng-utils/standalone/app_config.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/code_block.d.ts +46 -0
- package/schematics/src/utils/ng-utils/standalone/code_block.js +73 -0
- package/schematics/src/utils/ng-utils/standalone/code_block.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/index.d.ts +1 -0
- package/schematics/src/utils/ng-utils/standalone/index.js +7 -0
- package/schematics/src/utils/ng-utils/standalone/index.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/rules.d.ts +38 -0
- package/schematics/src/utils/ng-utils/standalone/rules.js +195 -0
- package/schematics/src/utils/ng-utils/standalone/rules.js.map +1 -0
- package/schematics/src/utils/ng-utils/standalone/util.d.ts +28 -0
- package/schematics/src/utils/ng-utils/standalone/util.js +138 -0
- package/schematics/src/utils/ng-utils/standalone/util.js.map +1 -0
- package/schematics/src/utils/normalize-options.d.ts +11 -0
- package/schematics/src/utils/normalize-options.js +27 -0
- package/schematics/src/utils/normalize-options.js.map +1 -0
- package/schematics/src/utils/project.d.ts +19 -0
- package/schematics/src/utils/project.js +46 -0
- package/schematics/src/utils/project.js.map +1 -0
- package/schematics/src/utils/versions.json +3 -0
- package/src/actions/symbols.d.ts +3 -17
- package/src/actions-stream.d.ts +2 -2
- package/src/configs/messages.config.d.ts +3 -1
- package/src/decorators/action.d.ts +28 -3
- package/src/decorators/select/select.d.ts +3 -0
- package/src/decorators/select/symbols.d.ts +2 -3
- package/src/decorators/selector/selector.d.ts +2 -3
- package/src/decorators/selector/symbols.d.ts +73 -4
- package/src/decorators/selector-options.d.ts +2 -2
- package/src/decorators/state.d.ts +2 -3
- package/src/dev-features/ngxs-development.module.d.ts +1 -0
- package/src/execution/symbols.d.ts +8 -2
- package/src/internal/dispatcher.d.ts +5 -5
- package/src/internal/fallback-subscriber.d.ts +3 -0
- package/src/internal/internals.d.ts +13 -69
- package/src/internal/lifecycle-state-manager.d.ts +6 -6
- package/src/internal/state-factory.d.ts +8 -6
- package/src/internal/state-operations.d.ts +2 -2
- package/src/internal/unhandled-rxjs-error-callback.d.ts +2 -0
- package/src/module.d.ts +3 -14
- package/src/modules/ngxs-feature.module.d.ts +2 -9
- package/src/modules/ngxs-root.module.d.ts +2 -9
- package/src/ngxs-unhandled-error-handler.d.ts +16 -0
- package/src/operators/of-action.d.ts +3 -3
- package/src/plugin-manager.d.ts +1 -1
- package/src/plugin_api.d.ts +1 -5
- package/src/private_api.d.ts +1 -0
- package/src/public_api.d.ts +11 -8
- package/src/selectors/create-model-selector.d.ts +2 -2
- package/src/selectors/create-pick-selector.d.ts +1 -1
- package/src/selectors/create-property-selectors.d.ts +3 -3
- package/src/selectors/create-selector.d.ts +10 -10
- package/src/selectors/private_api.d.ts +7 -0
- package/src/selectors/selector-checks.util.d.ts +2 -2
- package/src/selectors/selector-metadata.d.ts +4 -4
- package/src/selectors/selector-models.d.ts +4 -4
- package/src/selectors/selector-types.util.d.ts +6 -7
- package/src/selectors/selector-utils.d.ts +3 -3
- package/src/standalone-features/feature-providers.d.ts +7 -0
- package/src/standalone-features/index.d.ts +4 -0
- package/src/standalone-features/initializers.d.ts +29 -0
- package/src/standalone-features/plugin.d.ts +17 -0
- package/src/standalone-features/preboot.d.ts +26 -0
- package/src/standalone-features/provide-states.d.ts +18 -0
- package/src/standalone-features/provide-store.d.ts +22 -0
- package/src/standalone-features/root-providers.d.ts +8 -0
- package/src/store.d.ts +13 -15
- package/src/symbols.d.ts +12 -54
- package/src/utils/compose.d.ts +1 -1
- package/src/utils/create-dispatch-map.d.ts +4 -0
- package/src/utils/create-select-map.d.ts +4 -0
- package/src/utils/dispatch.d.ts +2 -0
- package/src/utils/public_api.d.ts +4 -0
- package/src/utils/select.d.ts +16 -0
- package/src/utils/store-validators.d.ts +4 -3
- package/bundles/ngxs-store-internals-testing.umd.js +0 -684
- package/bundles/ngxs-store-internals-testing.umd.js.map +0 -1
- package/bundles/ngxs-store-internals.umd.js +0 -141
- package/bundles/ngxs-store-internals.umd.js.map +0 -1
- package/bundles/ngxs-store-operators.umd.js +0 -224
- package/bundles/ngxs-store-operators.umd.js.map +0 -1
- package/bundles/ngxs-store.umd.js +0 -3076
- package/bundles/ngxs-store.umd.js.map +0 -1
- package/esm2015/internals/index.js +0 -5
- package/esm2015/internals/initial-state.js +0 -17
- package/esm2015/internals/internal-tokens.js +0 -5
- package/esm2015/internals/memoize.js +0 -45
- package/esm2015/internals/ngxs-bootstrapper.js +0 -29
- package/esm2015/internals/src/symbols.js +0 -2
- package/esm2015/internals/symbols.js +0 -2
- package/esm2015/internals/testing/fresh-platform.js +0 -70
- package/esm2015/internals/testing/helpers/ngxs-test.module.js +0 -21
- package/esm2015/internals/testing/ngxs.setup.js +0 -46
- package/esm2015/internals/testing/symbol.js +0 -2
- package/esm2015/operators/append.js +0 -20
- package/esm2015/operators/iif.js +0 -38
- package/esm2015/operators/insert-item.js +0 -29
- package/esm2015/operators/patch.js +0 -21
- package/esm2015/operators/remove-item.js +0 -22
- package/esm2015/operators/update-item.js +0 -40
- package/esm2015/src/actions/actions.js +0 -16
- package/esm2015/src/actions/symbols.js +0 -2
- package/esm2015/src/actions-stream.js +0 -52
- package/esm2015/src/configs/messages.config.js +0 -36
- package/esm2015/src/decorators/action.js +0 -33
- package/esm2015/src/decorators/select/select-factory.js +0 -29
- package/esm2015/src/decorators/select/select.js +0 -26
- package/esm2015/src/decorators/select/symbols.js +0 -29
- package/esm2015/src/decorators/selector/selector.js +0 -32
- package/esm2015/src/decorators/selector/symbols.js +0 -2
- package/esm2015/src/decorators/selector-options.js +0 -21
- package/esm2015/src/decorators/state.js +0 -36
- package/esm2015/src/dev-features/ngxs-development.module.js +0 -22
- package/esm2015/src/dev-features/ngxs-unhandled-actions-logger.js +0 -46
- package/esm2015/src/dev-features/symbols.js +0 -6
- package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +0 -57
- package/esm2015/src/execution/symbols.js +0 -23
- package/esm2015/src/internal/custom-rxjs-subjects.js +0 -92
- package/esm2015/src/internal/dispatcher.js +0 -104
- package/esm2015/src/internal/error-handler.js +0 -64
- package/esm2015/src/internal/internals.js +0 -248
- package/esm2015/src/internal/lifecycle-state-manager.js +0 -79
- package/esm2015/src/internal/state-context-factory.js +0 -68
- package/esm2015/src/internal/state-factory.js +0 -288
- package/esm2015/src/internal/state-operations.js +0 -63
- package/esm2015/src/internal/state-operators.js +0 -20
- package/esm2015/src/internal/state-stream.js +0 -25
- package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +0 -25
- package/esm2015/src/module.js +0 -88
- package/esm2015/src/modules/ngxs-feature.module.js +0 -45
- package/esm2015/src/modules/ngxs-root.module.js +0 -41
- package/esm2015/src/operators/of-action.js +0 -102
- package/esm2015/src/plugin-manager.js +0 -37
- package/esm2015/src/plugin_api.js +0 -6
- package/esm2015/src/public_api.js +0 -27
- package/esm2015/src/public_to_deprecate.js +0 -14
- package/esm2015/src/selectors/create-model-selector.js +0 -30
- package/esm2015/src/selectors/create-pick-selector.js +0 -16
- package/esm2015/src/selectors/create-property-selectors.js +0 -20
- package/esm2015/src/selectors/create-selector.js +0 -9
- package/esm2015/src/selectors/selector-checks.util.js +0 -18
- package/esm2015/src/selectors/selector-metadata.js +0 -30
- package/esm2015/src/selectors/selector-models.js +0 -2
- package/esm2015/src/selectors/selector-types.util.js +0 -2
- package/esm2015/src/selectors/selector-utils.js +0 -74
- package/esm2015/src/state-token/state-token.js +0 -17
- package/esm2015/src/state-token/symbols.js +0 -2
- package/esm2015/src/store.js +0 -107
- package/esm2015/src/symbols.js +0 -58
- package/esm2015/src/utils/compose.js +0 -26
- package/esm2015/src/utils/store-validators.js +0 -25
- package/esm2015/src/utils/utils.js +0 -92
- package/fesm2015/ngxs-store-internals-testing.js.map +0 -1
- package/fesm2015/ngxs-store-internals.js +0 -101
- package/fesm2015/ngxs-store-internals.js.map +0 -1
- package/fesm2015/ngxs-store-operators.js.map +0 -1
- package/fesm2015/ngxs-store.js.map +0 -1
- package/internals/ngxs-bootstrapper.d.ts +0 -16
- package/internals/ngxs-store-internals.d.ts +0 -5
- package/internals/package.json +0 -10
- package/internals/src/symbols.d.ts +0 -7
- package/internals/testing/ngxs-store-internals-testing.d.ts +0 -5
- package/internals/testing/package.json +0 -10
- package/ngxs-store.d.ts +0 -5
- package/operators/ngxs-store-operators.d.ts +0 -5
- package/operators/package.json +0 -10
- package/src/internal/error-handler.d.ts +0 -26
- package/src/internal/state-stream.d.ts +0 -14
- package/src/public_to_deprecate.d.ts +0 -21
- package/src/state-token/state-token.d.ts +0 -7
- package/src/state-token/symbols.d.ts +0 -5
- /package/{esm2015/internals/ngxs-store-internals.js → esm2022/internals/ngxs-store-internals.mjs} +0 -0
- /package/{esm2015/internals/testing/ngxs-store-internals-testing.js → esm2022/internals/testing/ngxs-store-internals-testing.mjs} +0 -0
- /package/{esm2015/ngxs-store.js → esm2022/ngxs-store.mjs} +0 -0
- /package/{esm2015/operators/compose.js → esm2022/operators/compose.mjs} +0 -0
- /package/{esm2015/operators/index.js → esm2022/operators/index.mjs} +0 -0
- /package/{esm2015/operators/ngxs-store-operators.js → esm2022/operators/ngxs-store-operators.mjs} +0 -0
- /package/{esm2015/operators/types.js → esm2022/operators/types.mjs} +0 -0
- /package/{esm2015/operators/utils.js → esm2022/operators/utils.mjs} +0 -0
- /package/{esm2015/src/operators/leave-ngxs.js → esm2022/src/operators/leave-ngxs.mjs} +0 -0
- /package/{esm2015/src/selectors/index.js → esm2022/src/selectors/index.mjs} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* InjectionToken that registers preboot functions (called before the root initializer).
|
|
4
|
+
*/
|
|
5
|
+
export declare const NGXS_PREBOOT_FNS: InjectionToken<VoidFunction[]>;
|
|
6
|
+
/**
|
|
7
|
+
* This function registers a preboot function which will be called before the root
|
|
8
|
+
* store initializer is run, but after all of the NGXS features are provided and
|
|
9
|
+
* available for injection. This is useful for registering action stream listeners
|
|
10
|
+
* before any action is dispatched.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* bootstrapApplication(AppComponent, {
|
|
14
|
+
* providers: [
|
|
15
|
+
* provideStore(
|
|
16
|
+
* [CountriesState],
|
|
17
|
+
* withNgxsPreboot(() => {
|
|
18
|
+
* const actions$ = inject(Actions);
|
|
19
|
+
* actions$.subscribe(ctx => console.log(ctx));
|
|
20
|
+
* })
|
|
21
|
+
* )
|
|
22
|
+
* ]
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function withNgxsPreboot(prebootFn: VoidFunction): import("@angular/core").EnvironmentProviders;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
|
+
/**
|
|
4
|
+
* This version serves as a standalone alternative to `NgxsModule.forFeature`.
|
|
5
|
+
* It can be used in a similar manner to register feature states, but at the
|
|
6
|
+
* `Route` providers level:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const routes: Routes = [
|
|
10
|
+
* {
|
|
11
|
+
* path: 'products',
|
|
12
|
+
* loadComponent: async () => {...},
|
|
13
|
+
* providers: [provideStates([ProductsState])]
|
|
14
|
+
* }
|
|
15
|
+
* ];
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function provideStates(states: ɵStateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
|
+
import { NgxsModuleOptions } from '../symbols';
|
|
4
|
+
/**
|
|
5
|
+
* This function provides global store providers and initializes the store.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* bootstrapApplication(AppComponent, {
|
|
9
|
+
* providers: [provideStore([CountriesState])]
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The `provideStore` may be optionally called with a config before the list of features:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* provideStore([CountriesState], {
|
|
17
|
+
* developmentMode: !environment.production
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function provideStore(states?: ɵStateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
22
|
+
export declare function provideStore(states?: ɵStateClass[], options?: NgxsModuleOptions, ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Provider } from '@angular/core';
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
|
+
import { NgxsModuleOptions } from '../symbols';
|
|
4
|
+
/**
|
|
5
|
+
* This function provides the required providers when invoking `NgxsModule.forRoot`
|
|
6
|
+
* or `provideStore`. It is shared between the NgModule and standalone APIs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getRootProviders(states: ɵStateClass[], options: NgxsModuleOptions): Provider[];
|
package/src/store.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
2
|
import { Observable, Subscription } from 'rxjs';
|
|
3
|
+
import { ɵStateStream } from '@ngxs/store/internals';
|
|
3
4
|
import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
|
|
4
5
|
import { InternalStateOperations } from './internal/state-operations';
|
|
5
|
-
import { StateStream } from './internal/state-stream';
|
|
6
6
|
import { NgxsConfig } from './symbols';
|
|
7
|
-
import { StateToken } from './state-token/state-token';
|
|
8
7
|
import { StateFactory } from './internal/state-factory';
|
|
8
|
+
import { TypedSelector } from './selectors';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
export declare class Store {
|
|
11
11
|
private _stateStream;
|
|
@@ -19,29 +19,27 @@ export declare class Store {
|
|
|
19
19
|
* All selects would use this stream, and it would call leave only once for any state change across all active selectors.
|
|
20
20
|
*/
|
|
21
21
|
private _selectableStateStream;
|
|
22
|
-
constructor(_stateStream:
|
|
22
|
+
constructor(_stateStream: ɵStateStream, _internalStateOperations: InternalStateOperations, _config: NgxsConfig, _internalExecutionStrategy: InternalNgxsExecutionStrategy, _stateFactory: StateFactory, initialStateValue: any);
|
|
23
23
|
/**
|
|
24
24
|
* Dispatches event(s).
|
|
25
25
|
*/
|
|
26
|
-
dispatch(actionOrActions: any | any[]): Observable<
|
|
26
|
+
dispatch(actionOrActions: any | any[]): Observable<void>;
|
|
27
27
|
/**
|
|
28
28
|
* Selects a slice of data from the store.
|
|
29
29
|
*/
|
|
30
|
-
select<T>(selector:
|
|
31
|
-
select<T = any>(selector: string | Type<any>): Observable<T>;
|
|
32
|
-
select<T>(selector: StateToken<T>): Observable<T>;
|
|
30
|
+
select<T>(selector: TypedSelector<T>): Observable<T>;
|
|
33
31
|
/**
|
|
34
32
|
* Select one slice of data from the store.
|
|
35
33
|
*/
|
|
36
|
-
selectOnce<T>(selector:
|
|
37
|
-
selectOnce<T = any>(selector: string | Type<any>): Observable<T>;
|
|
38
|
-
selectOnce<T>(selector: StateToken<T>): Observable<T>;
|
|
34
|
+
selectOnce<T>(selector: TypedSelector<T>): Observable<T>;
|
|
39
35
|
/**
|
|
40
36
|
* Select a snapshot from the state.
|
|
41
37
|
*/
|
|
42
|
-
selectSnapshot<T>(selector:
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
selectSnapshot<T>(selector: TypedSelector<T>): T;
|
|
39
|
+
/**
|
|
40
|
+
* Select a signal from the state.
|
|
41
|
+
*/
|
|
42
|
+
selectSignal<T>(selector: TypedSelector<T>): Signal<T>;
|
|
45
43
|
/**
|
|
46
44
|
* Allow the user to subscribe to the root of the state
|
|
47
45
|
*/
|
|
@@ -54,7 +52,7 @@ export declare class Store {
|
|
|
54
52
|
* Reset the state to a specific point in time. This method is useful
|
|
55
53
|
* for plugin's who need to modify the state directly or unit testing.
|
|
56
54
|
*/
|
|
57
|
-
reset(state: any):
|
|
55
|
+
reset(state: any): void;
|
|
58
56
|
private getStoreBoundSelectorFn;
|
|
59
57
|
private initStateStream;
|
|
60
58
|
static ɵfac: i0.ɵɵFactoryDeclaration<Store, [null, null, null, null, null, { optional: true; }]>;
|
package/src/symbols.d.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { InjectionToken, Type } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { PlainObject, StateClass } from '@ngxs/store/internals';
|
|
4
3
|
import { StateOperator } from '@ngxs/store/operators';
|
|
4
|
+
import { ɵSharedSelectorOptions, ɵStateClass } from '@ngxs/store/internals';
|
|
5
5
|
import { NgxsExecutionStrategy } from './execution/symbols';
|
|
6
|
-
import { SharedSelectorOptions } from './internal/internals';
|
|
7
|
-
import { StateToken } from './state-token/state-token';
|
|
8
6
|
import * as i0 from "@angular/core";
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export
|
|
13
|
-
export declare const META_KEY = "NGXS_META";
|
|
14
|
-
export declare const META_OPTIONS_KEY = "NGXS_OPTIONS_META";
|
|
15
|
-
export declare const SELECTOR_META_KEY = "NGXS_SELECTOR_META";
|
|
16
|
-
export declare type NgxsLifeCycle = Partial<NgxsOnChanges> & Partial<NgxsOnInit> & Partial<NgxsAfterBootstrap>;
|
|
17
|
-
export declare type NgxsPluginFn = (state: any, mutation: any, next: NgxsNextPluginFn) => any;
|
|
7
|
+
export declare const ROOT_STATE_TOKEN: InjectionToken<ɵStateClass[]>;
|
|
8
|
+
export declare const FEATURE_STATE_TOKEN: InjectionToken<ɵStateClass[][]>;
|
|
9
|
+
export declare const NGXS_OPTIONS: InjectionToken<Partial<NgxsConfig>>;
|
|
10
|
+
export type NgxsLifeCycle = Partial<NgxsOnChanges> & Partial<NgxsOnInit> & Partial<NgxsAfterBootstrap>;
|
|
18
11
|
/**
|
|
19
12
|
* The NGXS config settings.
|
|
20
13
|
*/
|
|
@@ -24,9 +17,9 @@ export declare class NgxsConfig {
|
|
|
24
17
|
* - Object.freeze on the state and actions to guarantee immutability
|
|
25
18
|
* (default: false)
|
|
26
19
|
*
|
|
27
|
-
* Note: this property will be accounted only in development mode
|
|
20
|
+
* Note: this property will be accounted only in development mode.
|
|
28
21
|
* It makes sense to use it only during development to ensure there're no state mutations.
|
|
29
|
-
* When building for production, the Object.freeze will be tree-shaken away.
|
|
22
|
+
* When building for production, the `Object.freeze` will be tree-shaken away.
|
|
30
23
|
*/
|
|
31
24
|
developmentMode: boolean;
|
|
32
25
|
compatibility: {
|
|
@@ -42,25 +35,17 @@ export declare class NgxsConfig {
|
|
|
42
35
|
* provided to override the default behaviour where the async operations are run
|
|
43
36
|
* outside Angular's zone but all observable behaviours of NGXS are run back inside Angular's zone.
|
|
44
37
|
* These observable behaviours are from:
|
|
45
|
-
*
|
|
38
|
+
* `store.selectSignal(...)`, `store.select(...)`, `actions.subscribe(...)` or `store.dispatch(...).subscribe(...)`
|
|
46
39
|
* Every `zone.run` causes Angular to run change detection on the whole tree (`app.tick()`) so of your
|
|
47
40
|
* application doesn't rely on zone.js running change detection then you can switch to the
|
|
48
41
|
* `NoopNgxsExecutionStrategy` that doesn't interact with zones.
|
|
49
42
|
* (default: null)
|
|
50
43
|
*/
|
|
51
44
|
executionStrategy: Type<NgxsExecutionStrategy>;
|
|
52
|
-
/**
|
|
53
|
-
* Defining the default state before module initialization
|
|
54
|
-
* This is convenient if we need to create a define our own set of states.
|
|
55
|
-
* @deprecated will be removed after v4
|
|
56
|
-
* (default: {})
|
|
57
|
-
*/
|
|
58
|
-
defaultsState: PlainObject;
|
|
59
45
|
/**
|
|
60
46
|
* Defining shared selector options
|
|
61
47
|
*/
|
|
62
|
-
selectorOptions:
|
|
63
|
-
constructor();
|
|
48
|
+
selectorOptions: ɵSharedSelectorOptions;
|
|
64
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsConfig, never>;
|
|
65
50
|
static ɵprov: i0.ɵɵInjectableDeclaration<NgxsConfig>;
|
|
66
51
|
}
|
|
@@ -76,43 +61,16 @@ export interface StateContext<T> {
|
|
|
76
61
|
/**
|
|
77
62
|
* Reset the state to a new value.
|
|
78
63
|
*/
|
|
79
|
-
setState(val: T | StateOperator<T>):
|
|
64
|
+
setState(val: T | StateOperator<T>): void;
|
|
80
65
|
/**
|
|
81
66
|
* Patch the existing state with the provided value.
|
|
82
67
|
*/
|
|
83
|
-
patchState(val: Partial<T>):
|
|
68
|
+
patchState(val: Partial<T>): void;
|
|
84
69
|
/**
|
|
85
70
|
* Dispatch a new action and return the dispatched observable.
|
|
86
71
|
*/
|
|
87
72
|
dispatch(actions: any | any[]): Observable<void>;
|
|
88
73
|
}
|
|
89
|
-
export declare type NgxsNextPluginFn = (state: any, mutation: any) => any;
|
|
90
|
-
/**
|
|
91
|
-
* Plugin interface
|
|
92
|
-
*/
|
|
93
|
-
export interface NgxsPlugin {
|
|
94
|
-
/**
|
|
95
|
-
* Handle the state/action before its submitted to the state handlers.
|
|
96
|
-
*/
|
|
97
|
-
handle(state: any, action: any, next: NgxsNextPluginFn): any;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Options that can be provided to the store.
|
|
101
|
-
*/
|
|
102
|
-
export interface StoreOptions<T> {
|
|
103
|
-
/**
|
|
104
|
-
* Name of the state. Required.
|
|
105
|
-
*/
|
|
106
|
-
name: string | StateToken<T>;
|
|
107
|
-
/**
|
|
108
|
-
* Default values for the state. If not provided, uses empty object.
|
|
109
|
-
*/
|
|
110
|
-
defaults?: T;
|
|
111
|
-
/**
|
|
112
|
-
* Sub states for the given state.
|
|
113
|
-
*/
|
|
114
|
-
children?: StateClass[];
|
|
115
|
-
}
|
|
116
74
|
/**
|
|
117
75
|
* Represents a basic change from a previous to a new value for a single state instance.
|
|
118
76
|
* Passed as a value in a NgxsSimpleChanges object to the ngxsOnChanges hook.
|
|
@@ -141,4 +99,4 @@ export interface NgxsOnChanges {
|
|
|
141
99
|
export interface NgxsAfterBootstrap {
|
|
142
100
|
ngxsAfterBootstrap(ctx: StateContext<any>): void;
|
|
143
101
|
}
|
|
144
|
-
export
|
|
102
|
+
export type NgxsModuleOptions = Partial<NgxsConfig>;
|
package/src/utils/compose.d.ts
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ActionDef } from '../actions/symbols';
|
|
3
|
+
export type ActionMap = Record<string, ActionDef<any>>;
|
|
4
|
+
export declare function createDispatchMap<T extends ActionMap>(actionMap: T): { readonly [K in keyof T]: (...args: ConstructorParameters<T[K]>) => Observable<void>; };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { TypedSelector, ɵSelectorReturnType } from '../selectors';
|
|
3
|
+
export type SelectorMap = Record<string, TypedSelector<unknown>>;
|
|
4
|
+
export declare function createSelectMap<T extends SelectorMap>(selectorMap: T): { readonly [K in keyof T]: Signal<ɵSelectorReturnType<T[K]>>; };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { TypedSelector } from '../selectors';
|
|
3
|
+
/**
|
|
4
|
+
* This function serves as a utility and has multiple purposes.
|
|
5
|
+
* Firstly, it allows you to select properties from the state class
|
|
6
|
+
* without having to inject the store class and use `this.store.selectSignal`,
|
|
7
|
+
* resulting in a more concise implementation. Secondly, it can be used with
|
|
8
|
+
* other solutions such as NgRx signal store with its `signalStoreFeature` or
|
|
9
|
+
* `withComputed` functionalities.
|
|
10
|
+
*
|
|
11
|
+
* Please note that it's named `select` instead of `selectSignal` because
|
|
12
|
+
* signals are evolving into first-class primitives in Angular, displacing other
|
|
13
|
+
* primitives such as observables. Observables represent a stream of events,
|
|
14
|
+
* whereas signals represent a single value changing over time.
|
|
15
|
+
*/
|
|
16
|
+
export declare function select<T>(selector: TypedSelector<T>): Signal<T>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵStateClassInternal } from '@ngxs/store/internals';
|
|
2
|
+
import { StatesByName } from '../internal/internals';
|
|
2
3
|
export declare function ensureStateNameIsValid(name: string | null): void | never;
|
|
3
|
-
export declare function ensureStateNameIsUnique(stateName: string, state:
|
|
4
|
-
export declare function ensureStatesAreDecorated(stateClasses:
|
|
4
|
+
export declare function ensureStateNameIsUnique(stateName: string, state: ɵStateClassInternal, statesByName: StatesByName): void | never;
|
|
5
|
+
export declare function ensureStatesAreDecorated(stateClasses: ɵStateClassInternal[]): void | never;
|