@ngxs/store 3.8.2-dev.master-87ee261 → 3.8.2-dev.master-3d36414
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/esm2022/src/internal/dispatcher.mjs +11 -11
- package/esm2022/src/internal/fallback-subscriber.mjs +29 -0
- package/esm2022/src/internal/lifecycle-state-manager.mjs +10 -20
- package/esm2022/src/internal/state-factory.mjs +14 -2
- package/esm2022/src/internal/unhandled-rxjs-error-callback.mjs +39 -0
- package/esm2022/src/ngxs-unhandled-error-handler.mjs +29 -0
- package/esm2022/src/public_api.mjs +2 -1
- package/fesm2022/ngxs-store.mjs +117 -83
- package/fesm2022/ngxs-store.mjs.map +1 -1
- package/index.d.ts +22 -15
- package/package.json +2 -2
- package/esm2022/src/internal/error-handler.mjs +0 -64
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Type, ModuleWithProviders,
|
|
2
|
+
import { Type, ModuleWithProviders, OnDestroy, NgZone, Injector, Signal, EnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { ɵSharedSelectorOptions as _SharedSelectorOptions, ɵStateClass as _StateClass, ɵActionOptions as _ActionOptions, ɵPlainObjectOf as _PlainObjectOf, ɵStateClassInternal as _StateClassInternal, ɵActionHandlerMetaData as _ActionHandlerMetaData, ɵOrderedSubject as _OrderedSubject, ɵStateStream as _StateStream, ɵRuntimeSelectorContext as _RuntimeSelectorContext, StateToken, ɵStoreOptions as _StoreOptions, ɵExtractTokenType as _ExtractTokenType } from '@ngxs/store/internals';
|
|
4
4
|
export { ɵActionOptions as ActionOptions, StateToken } from '@ngxs/store/internals';
|
|
5
5
|
import { Observable, Subject, Subscription, OperatorFunction } from 'rxjs';
|
|
@@ -175,16 +175,6 @@ interface StatesAndDefaults {
|
|
|
175
175
|
states: MappedStore[];
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
declare class InternalErrorReporter {
|
|
179
|
-
private _injector;
|
|
180
|
-
/** Will be set lazily to be backward compatible. */
|
|
181
|
-
private _errorHandler;
|
|
182
|
-
constructor(_injector: Injector);
|
|
183
|
-
reportErrorSafely(error: any): void;
|
|
184
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<InternalErrorReporter, never>;
|
|
185
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<InternalErrorReporter>;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
178
|
/**
|
|
189
179
|
* Status of a dispatched action
|
|
190
180
|
*/
|
|
@@ -241,13 +231,13 @@ declare class InternalDispatchedActionResults extends Subject<ActionContext> {
|
|
|
241
231
|
static ɵprov: i0.ɵɵInjectableDeclaration<InternalDispatchedActionResults>;
|
|
242
232
|
}
|
|
243
233
|
declare class InternalDispatcher {
|
|
234
|
+
private _ngZone;
|
|
244
235
|
private _actions;
|
|
245
236
|
private _actionResults;
|
|
246
237
|
private _pluginManager;
|
|
247
238
|
private _stateStream;
|
|
248
239
|
private _ngxsExecutionStrategy;
|
|
249
|
-
|
|
250
|
-
constructor(_actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: _StateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy, _internalErrorReporter: InternalErrorReporter);
|
|
240
|
+
constructor(_ngZone: NgZone, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: _StateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy);
|
|
251
241
|
/**
|
|
252
242
|
* Dispatches event(s).
|
|
253
243
|
*/
|
|
@@ -315,6 +305,7 @@ declare class StateFactory implements OnDestroy {
|
|
|
315
305
|
private _initialState;
|
|
316
306
|
private _actionsSubscription;
|
|
317
307
|
private _propGetter;
|
|
308
|
+
private _ngxsUnhandledErrorHandler;
|
|
318
309
|
constructor(_injector: Injector, _config: NgxsConfig, _parentFactory: StateFactory, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _stateContextFactory: StateContextFactory, _initialState: any);
|
|
319
310
|
private _states;
|
|
320
311
|
get states(): MappedStore[];
|
|
@@ -336,7 +327,7 @@ declare class StateFactory implements OnDestroy {
|
|
|
336
327
|
/**
|
|
337
328
|
* Invoke actions on the states.
|
|
338
329
|
*/
|
|
339
|
-
invokeActions(dispatched$: Observable<ActionContext>, action: any): Observable<
|
|
330
|
+
invokeActions(dispatched$: Observable<ActionContext>, action: any): Observable<[any]>;
|
|
340
331
|
private addToStatesMap;
|
|
341
332
|
private addRuntimeInfoToMeta;
|
|
342
333
|
private hasBeenMountedAndBootstrapped;
|
|
@@ -534,6 +525,22 @@ declare class NoopNgxsExecutionStrategy implements NgxsExecutionStrategy {
|
|
|
534
525
|
static ɵprov: i0.ɵɵInjectableDeclaration<NoopNgxsExecutionStrategy>;
|
|
535
526
|
}
|
|
536
527
|
|
|
528
|
+
interface NgxsUnhandledErrorContext {
|
|
529
|
+
action: any;
|
|
530
|
+
}
|
|
531
|
+
declare class NgxsUnhandledErrorHandler {
|
|
532
|
+
private _ngZone;
|
|
533
|
+
private _errorHandler;
|
|
534
|
+
/**
|
|
535
|
+
* The `_unhandledErrorContext` is left unused internally since we do not
|
|
536
|
+
* require it for internal operations. However, developers who wish to provide
|
|
537
|
+
* their own custom error handler may utilize this context information.
|
|
538
|
+
*/
|
|
539
|
+
handleError(error: any, _unhandledErrorContext: NgxsUnhandledErrorContext): void;
|
|
540
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsUnhandledErrorHandler, never>;
|
|
541
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxsUnhandledErrorHandler>;
|
|
542
|
+
}
|
|
543
|
+
|
|
537
544
|
interface NgxsDevelopmentOptions {
|
|
538
545
|
warnOnUnhandledActions: true | {
|
|
539
546
|
ignore: ActionType[];
|
|
@@ -616,4 +623,4 @@ declare function provideStates(states: _StateClass[], ...features: EnvironmentPr
|
|
|
616
623
|
*/
|
|
617
624
|
declare function withNgxsPlugin(plugin: Type<NgxsPlugin>): EnvironmentProviders;
|
|
618
625
|
|
|
619
|
-
export { Action, type ActionCompletion, type ActionContext, ActionStatus, type ActionType, Actions, type NgxsAfterBootstrap, NgxsDevelopmentModule, type NgxsDevelopmentOptions, type NgxsExecutionStrategy, NgxsModule, type NgxsModuleOptions, type NgxsOnChanges, type NgxsOnInit, NgxsSimpleChange, NgxsUnhandledActionsLogger, NoopNgxsExecutionStrategy, type PropertySelectors, Select, Selector, SelectorOptions, State, type StateContext, Store, type TypedSelector, createModelSelector, createPickSelector, createPropertySelectors, createSelector, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, provideStates, provideStore, withNgxsDevelopmentOptions, withNgxsPlugin, NgxsFeatureModule as ɵNgxsFeatureModule, NgxsRootModule as ɵNgxsRootModule, type ɵSelectorDef, type ɵSelectorFunc, type ɵSelectorReturnType, type ɵStateSelector };
|
|
626
|
+
export { Action, type ActionCompletion, type ActionContext, ActionStatus, type ActionType, Actions, type NgxsAfterBootstrap, NgxsDevelopmentModule, type NgxsDevelopmentOptions, type NgxsExecutionStrategy, NgxsModule, type NgxsModuleOptions, type NgxsOnChanges, type NgxsOnInit, NgxsSimpleChange, NgxsUnhandledActionsLogger, type NgxsUnhandledErrorContext, NgxsUnhandledErrorHandler, NoopNgxsExecutionStrategy, type PropertySelectors, Select, Selector, SelectorOptions, State, type StateContext, Store, type TypedSelector, createModelSelector, createPickSelector, createPropertySelectors, createSelector, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, provideStates, provideStore, withNgxsDevelopmentOptions, withNgxsPlugin, NgxsFeatureModule as ɵNgxsFeatureModule, NgxsRootModule as ɵNgxsRootModule, type ɵSelectorDef, type ɵSelectorFunc, type ɵSelectorReturnType, type ɵStateSelector };
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngxs/store",
|
|
3
|
-
"version": "3.8.2-dev.master-
|
|
3
|
+
"version": "3.8.2-dev.master-3d36414",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@angular/core": ">=12.0.0 <18.0.0",
|
|
8
|
-
"rxjs": ">=
|
|
8
|
+
"rxjs": ">=7.0.0"
|
|
9
9
|
},
|
|
10
10
|
"schematics": "./schematics/collection.json",
|
|
11
11
|
"module": "fesm2022/ngxs-store.mjs",
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ErrorHandler, Injectable, Injector } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { leaveNgxs } from '../operators/leave-ngxs';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* This operator is used for piping the observable result
|
|
7
|
-
* from the `dispatch()`. It has a "smart" error handling
|
|
8
|
-
* strategy that allows us to decide whether we propagate
|
|
9
|
-
* errors to Angular's `ErrorHandler` or enable users to
|
|
10
|
-
* handle them manually. We consider following cases:
|
|
11
|
-
* 1) `store.dispatch()` (no subscribe) -> call `handleError()`
|
|
12
|
-
* 2) `store.dispatch().subscribe()` (no error callback) -> call `handleError()`
|
|
13
|
-
* 3) `store.dispatch().subscribe({ error: ... })` -> don't call `handleError()`
|
|
14
|
-
* 4) `toPromise()` without `catch` -> do `handleError()`
|
|
15
|
-
* 5) `toPromise()` with `catch` -> don't `handleError()`
|
|
16
|
-
*/
|
|
17
|
-
export function ngxsErrorHandler(internalErrorReporter, ngxsExecutionStrategy) {
|
|
18
|
-
return (source) => {
|
|
19
|
-
let subscribed = false;
|
|
20
|
-
source.subscribe({
|
|
21
|
-
error: error => {
|
|
22
|
-
// Do not trigger change detection for a microtask. This depends on the execution
|
|
23
|
-
// strategy being used, but the default `DispatchOutsideZoneNgxsExecutionStrategy`
|
|
24
|
-
// leaves the Angular zone.
|
|
25
|
-
ngxsExecutionStrategy.enter(() => Promise.resolve().then(() => {
|
|
26
|
-
if (!subscribed) {
|
|
27
|
-
ngxsExecutionStrategy.leave(() => internalErrorReporter.reportErrorSafely(error));
|
|
28
|
-
}
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return new Observable(subscriber => {
|
|
33
|
-
subscribed = true;
|
|
34
|
-
return source.pipe(leaveNgxs(ngxsExecutionStrategy)).subscribe(subscriber);
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export class InternalErrorReporter {
|
|
39
|
-
constructor(_injector) {
|
|
40
|
-
this._injector = _injector;
|
|
41
|
-
/** Will be set lazily to be backward compatible. */
|
|
42
|
-
this._errorHandler = null;
|
|
43
|
-
}
|
|
44
|
-
reportErrorSafely(error) {
|
|
45
|
-
if (this._errorHandler === null) {
|
|
46
|
-
this._errorHandler = this._injector.get(ErrorHandler);
|
|
47
|
-
}
|
|
48
|
-
// The `try-catch` is used to avoid handling the error twice. Suppose we call
|
|
49
|
-
// `handleError` which re-throws the error internally. The re-thrown error will
|
|
50
|
-
// be caught by zone.js which will then get to the `zone.onError.emit()` and the
|
|
51
|
-
// `onError` subscriber will call `handleError` again.
|
|
52
|
-
try {
|
|
53
|
-
this._errorHandler.handleError(error);
|
|
54
|
-
}
|
|
55
|
-
catch { }
|
|
56
|
-
}
|
|
57
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: InternalErrorReporter, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
58
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: InternalErrorReporter, providedIn: 'root' }); }
|
|
59
|
-
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: InternalErrorReporter, decorators: [{
|
|
61
|
-
type: Injectable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