@ngxs/store 21.0.0-dev.master-416d6de → 22.0.0-dev.master-8c6b0fc

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ModuleWithProviders, Signal, EnvironmentProviders, Type } from '@angular/core';
3
- import { ɵActionOptions as _ActionOptions, StateToken, ɵSharedSelectorOptions as _SharedSelectorOptions, ɵStateClass as _StateClass, ɵStoreOptions as _StoreOptions, ɵPlainObjectOf as _PlainObjectOf, ɵActionHandlerMetaData as _ActionHandlerMetaData, ɵStateClassInternal as _StateClassInternal } from '@ngxs/store/internals';
4
- export { ɵActionOptions as ActionOptions, StateToken } from '@ngxs/store/internals';
3
+ import { ɵSharedSelectorOptions as _SharedSelectorOptions, ɵStateClass as _StateClass, ActionType, ɵActionOptions as _ActionOptions, ActionDef, StateToken, ɵStoreOptions as _StoreOptions, ɵNgxsDevelopmentOptions as _NgxsDevelopmentOptions, ɵPlainObjectOf as _PlainObjectOf, ɵActionHandlerMetaData as _ActionHandlerMetaData, ɵStateClassInternal as _StateClassInternal } from '@ngxs/store/internals';
4
+ export { ActionDef, ɵActionOptions as ActionOptions, ActionType, ɵNgxsDevelopmentOptions as NgxsDevelopmentOptions, StateToken } from '@ngxs/store/internals';
5
5
  import { Observable, Subscription, OperatorFunction } from 'rxjs';
6
6
  import { StateOperator } from '@ngxs/store/operators';
7
7
  export { StateOperator } from '@ngxs/store/operators';
@@ -134,14 +134,6 @@ declare class NgxsModule {
134
134
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxsModule>;
135
135
  }
136
136
 
137
- interface ActionDef<TArgs extends any[] = any[], TReturn = any> {
138
- type: string;
139
- new (...args: TArgs): TReturn;
140
- }
141
- type ActionType = ActionDef | {
142
- type: string;
143
- };
144
-
145
137
  /**
146
138
  * Given an action class, returns its payload.
147
139
  */
@@ -465,15 +457,6 @@ declare class NgxsUnhandledErrorHandler {
465
457
  static ɵprov: i0.ɵɵInjectableDeclaration<NgxsUnhandledErrorHandler>;
466
458
  }
467
459
 
468
- interface NgxsDevelopmentOptions {
469
- warnOnNewReferenceWithIdenticalValue?: {
470
- isEqual: (a: unknown, b: unknown) => boolean;
471
- };
472
- warnOnUnhandledActions: true | {
473
- ignore: ActionType[];
474
- };
475
- }
476
-
477
460
  /**
478
461
  * @deprecated Use `withNgxsDevelopmentOptions()` instead.
479
462
  */
@@ -481,12 +464,12 @@ declare class NgxsDevelopmentModule {
481
464
  /**
482
465
  * @deprecated Use `withNgxsDevelopmentOptions()` instead.
483
466
  */
484
- static forRoot(options: NgxsDevelopmentOptions): ModuleWithProviders<NgxsDevelopmentModule>;
467
+ static forRoot(options: _NgxsDevelopmentOptions): ModuleWithProviders<NgxsDevelopmentModule>;
485
468
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxsDevelopmentModule, never>;
486
469
  static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsDevelopmentModule, never, never, never>;
487
470
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxsDevelopmentModule>;
488
471
  }
489
- declare function withNgxsDevelopmentOptions(options: NgxsDevelopmentOptions): i0.EnvironmentProviders;
472
+ declare function withNgxsDevelopmentOptions(options: _NgxsDevelopmentOptions): i0.EnvironmentProviders;
490
473
 
491
474
  declare class NgxsUnhandledActionsLogger {
492
475
  /**
@@ -759,4 +742,4 @@ declare function ɵgetTypedNgxsStateFactory(stateFactory: any): {
759
742
  };
760
743
 
761
744
  export { Action, ActionDirector, ActionStatus, Actions, AsyncReturnType, NgxsConfig, NgxsDevelopmentModule, NgxsModule, NgxsSimpleChange, NgxsUnhandledActionsLogger, NgxsUnhandledErrorHandler, Select, Selector, SelectorOptions, State, StateContextDestroyedError, Store, createDispatchMap, createModelSelector, createPickSelector, createPropertySelectors, createSelectMap, createSelector, dispatch, lazyProvider, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, provideStates, provideStore, registerNgxsPlugin, select, withNgxsDevelopmentOptions, withNgxsNoopExecutionStrategy, withNgxsPendingTasks, withNgxsPlugin, withNgxsPreboot, NgxsFeatureModule as ɵNgxsFeatureModule, NgxsRootModule as ɵNgxsRootModule, ɵgetTypedNgxsStateFactory, ɵprovideNgxsInternalStateTokens };
762
- export type { ActionCompletion, ActionContext, ActionDef, ActionMap, ActionType, NgxsAfterBootstrap, NgxsDevelopmentOptions, NgxsModuleOptions, NgxsOnChanges, NgxsOnInit, NgxsUnhandledErrorContext, PropertySelectors, SelectorMap, StateContext, TypedSelector, ɵSelectorDef, ɵSelectorFunc, ɵSelectorReturnType, ɵStateSelector };
745
+ export type { ActionCompletion, ActionContext, ActionMap, NgxsAfterBootstrap, NgxsModuleOptions, NgxsOnChanges, NgxsOnInit, NgxsUnhandledErrorContext, PropertySelectors, SelectorMap, StateContext, TypedSelector, ɵSelectorDef, ɵSelectorFunc, ɵSelectorReturnType, ɵStateSelector };
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Signal } from '@angular/core';
3
- import { Observable, BehaviorSubject, Subject, MonoTypeOperatorFunction } from 'rxjs';
3
+ import { BehaviorSubject, Subject, MonoTypeOperatorFunction, Observable } from 'rxjs';
4
4
 
5
5
  declare class StateToken<T = void> {
6
6
  private readonly _name;
@@ -94,7 +94,16 @@ interface ɵActionHandlerMetaData {
94
94
  fn: string | symbol;
95
95
  options: ɵActionOptions;
96
96
  type: string;
97
+ /** The action class this handler was registered for, used to detect `type` collisions in dev mode. */
98
+ actionClass: unknown;
97
99
  }
100
+ interface ActionDef<TArgs extends any[] = any[], TReturn = any> {
101
+ type: string;
102
+ new (...args: TArgs): TReturn;
103
+ }
104
+ type ActionType = ActionDef | {
105
+ type: string;
106
+ };
98
107
 
99
108
  /**
100
109
  * Ensures metadata is attached to the class and returns it.
@@ -202,12 +211,29 @@ declare const ɵdefineProperty: <T>(o: T, p: PropertyKey, attributes: PropertyDe
202
211
  type ActionHandlerFn = (action: any) => Observable<unknown>;
203
212
  declare class ɵNgxsActionRegistry {
204
213
  private readonly _actionTypeToHandlersMap;
214
+ private readonly _actionTypeToClass?;
205
215
  constructor();
206
216
  get(type: string): Set<ActionHandlerFn> | undefined;
207
- register(type: string, handler: ActionHandlerFn): () => void;
217
+ register(type: string, handler: ActionHandlerFn, actionClass?: unknown): () => void;
208
218
  static ɵfac: i0.ɵɵFactoryDeclaration<ɵNgxsActionRegistry, never>;
209
219
  static ɵprov: i0.ɵɵInjectableDeclaration<ɵNgxsActionRegistry>;
210
220
  }
211
221
 
212
- export { StateToken, ɵINITIAL_STATE_TOKEN, ɵInitialState, ɵMETA_KEY, ɵMETA_OPTIONS_KEY, ɵNGXS_APP_BOOTSTRAP_STATE, ɵNGXS_STATE_CONTEXT_FACTORY, ɵNGXS_STATE_FACTORY, ɵNgxsActionRegistry, ɵOrderedBehaviorSubject, ɵOrderedSubject, ɵSELECTOR_META_KEY, ɵStateStream, ɵdefineProperty, ɵensureSelectorMetadata, ɵensureStoreMetadata, ɵgetSelectorMetadata, ɵgetStoreMetadata, ɵhasOwnProperty, ɵmemoize, ɵwrapObserverCalls };
213
- export type { ɵActionHandlerMetaData, ɵActionOptions, ɵExtractTokenType, ɵMetaDataModel, ɵPlainObject, ɵPlainObjectOf, ɵRuntimeSelectorContext, ɵSelectFromRootState, ɵSelectorFactory, ɵSelectorMetaDataModel, ɵSharedSelectorOptions, ɵStateClass, ɵStateClassInternal, ɵStateToken, ɵStoreOptions, ɵTokenName };
222
+ interface ɵNgxsDevelopmentOptions {
223
+ warnOnNewReferenceWithIdenticalValue?: {
224
+ isEqual: (a: unknown, b: unknown) => boolean;
225
+ };
226
+ warnOnUnhandledActions: true | {
227
+ ignore: ActionType[];
228
+ };
229
+ /**
230
+ * Warns when two different action classes are declared with the same `type` string.
231
+ * Since handlers are looked up by `type`, every handler registered for that type runs
232
+ * whenever either action is dispatched, even though their payloads may differ.
233
+ */
234
+ warnOnDuplicateActionTypes?: boolean;
235
+ }
236
+ declare const ɵNGXS_DEVELOPMENT_OPTIONS: InjectionToken<ɵNgxsDevelopmentOptions>;
237
+
238
+ export { StateToken, ɵINITIAL_STATE_TOKEN, ɵInitialState, ɵMETA_KEY, ɵMETA_OPTIONS_KEY, ɵNGXS_APP_BOOTSTRAP_STATE, ɵNGXS_DEVELOPMENT_OPTIONS, ɵNGXS_STATE_CONTEXT_FACTORY, ɵNGXS_STATE_FACTORY, ɵNgxsActionRegistry, ɵOrderedBehaviorSubject, ɵOrderedSubject, ɵSELECTOR_META_KEY, ɵStateStream, ɵdefineProperty, ɵensureSelectorMetadata, ɵensureStoreMetadata, ɵgetSelectorMetadata, ɵgetStoreMetadata, ɵhasOwnProperty, ɵmemoize, ɵwrapObserverCalls };
239
+ export type { ActionDef, ActionType, ɵActionHandlerMetaData, ɵActionOptions, ɵExtractTokenType, ɵMetaDataModel, ɵNgxsDevelopmentOptions, ɵPlainObject, ɵPlainObjectOf, ɵRuntimeSelectorContext, ɵSelectFromRootState, ɵSelectorFactory, ɵSelectorMetaDataModel, ɵSharedSelectorOptions, ɵStateClass, ɵStateClassInternal, ɵStateToken, ɵStoreOptions, ɵTokenName };
@@ -1,6 +1,6 @@
1
1
  import { NgxsModuleOptions, Store } from '@ngxs/store';
2
2
  import * as i0 from '@angular/core';
3
- import { EnvironmentProviders, ModuleWithProviders } from '@angular/core';
3
+ import { ModuleWithProviders, EnvironmentProviders } from '@angular/core';
4
4
  import { TestBedStatic } from '@angular/core/testing';
5
5
  import { ɵStateClass as _StateClass } from '@ngxs/store/internals';
6
6
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@ngxs/store",
3
- "version": "21.0.0-dev.master-416d6de",
3
+ "version": "22.0.0-dev.master-8c6b0fc",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
- "@angular/core": ">=21.0.0 <22.0.0",
7
+ "@angular/core": ">=22.0.0 <23.0.0",
8
8
  "rxjs": ">=7.0.0"
9
9
  },
10
10
  "schematics": "./schematics/collection.json",
@@ -18,14 +18,14 @@
18
18
  "types": "./index.d.ts",
19
19
  "default": "./fesm2022/ngxs-store.mjs"
20
20
  },
21
- "./internals": {
22
- "types": "./internals/index.d.ts",
23
- "default": "./fesm2022/ngxs-store-internals.mjs"
24
- },
25
21
  "./experimental": {
26
22
  "types": "./experimental/index.d.ts",
27
23
  "default": "./fesm2022/ngxs-store-experimental.mjs"
28
24
  },
25
+ "./internals": {
26
+ "types": "./internals/index.d.ts",
27
+ "default": "./fesm2022/ngxs-store-internals.mjs"
28
+ },
29
29
  "./operators": {
30
30
  "types": "./operators/index.d.ts",
31
31
  "default": "./fesm2022/ngxs-store-operators.mjs"
@@ -61,18 +61,9 @@
61
61
  ],
62
62
  "author": "Austin McDaniel",
63
63
  "contributors": [
64
- {
65
- "name": "Danny Blue"
66
- },
67
- {
68
- "name": "Leon Radley"
69
- },
70
64
  {
71
65
  "name": "Mark Whitfeld"
72
66
  },
73
- {
74
- "name": "Maxim Ivanov"
75
- },
76
67
  {
77
68
  "name": "Artur Androsovych"
78
69
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "@ngxs/store": "21.0.0"
2
+ "@ngxs/store": "22.0.0"
3
3
  }