@angular-architects/ngrx-toolkit 19.2.3 → 19.4.0
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/eslint.config.cjs +43 -0
- package/jest.config.ts +22 -0
- package/ng-package.json +7 -0
- package/package.json +4 -21
- package/project.json +37 -0
- package/redux-connector/docs/README.md +131 -0
- package/redux-connector/index.ts +6 -0
- package/redux-connector/ng-package.json +5 -0
- package/redux-connector/src/lib/create-redux.ts +102 -0
- package/redux-connector/src/lib/model.ts +89 -0
- package/redux-connector/src/lib/rxjs-interop/redux-method.ts +66 -0
- package/redux-connector/src/lib/signal-redux-store.ts +59 -0
- package/redux-connector/src/lib/util.ts +22 -0
- package/{index.d.ts → src/index.ts} +36 -4
- package/src/lib/assertions/assertions.ts +9 -0
- package/{lib/devtools/features/with-disabled-name-indicies.d.ts → src/lib/devtools/features/with-disabled-name-indicies.ts} +5 -1
- package/{lib/devtools/features/with-glitch-tracking.d.ts → src/lib/devtools/features/with-glitch-tracking.ts} +6 -1
- package/{lib/devtools/features/with-mapper.d.ts → src/lib/devtools/features/with-mapper.ts} +7 -1
- package/src/lib/devtools/internal/current-action-names.ts +1 -0
- package/src/lib/devtools/internal/default-tracker.ts +60 -0
- package/src/lib/devtools/internal/devtools-feature.ts +37 -0
- package/src/lib/devtools/internal/devtools-syncer.service.ts +202 -0
- package/src/lib/devtools/internal/glitch-tracker.service.ts +61 -0
- package/src/lib/devtools/internal/models.ts +29 -0
- package/{lib/devtools/provide-devtools-config.d.ts → src/lib/devtools/provide-devtools-config.ts} +16 -4
- package/src/lib/devtools/rename-devtools-name.ts +21 -0
- package/src/lib/devtools/tests/action-name.spec.ts +48 -0
- package/src/lib/devtools/tests/basic.spec.ts +111 -0
- package/src/lib/devtools/tests/connecting.spec.ts +37 -0
- package/src/lib/devtools/tests/helpers.spec.ts +43 -0
- package/src/lib/devtools/tests/naming.spec.ts +216 -0
- package/src/lib/devtools/tests/provide-devtools-config.spec.ts +25 -0
- package/src/lib/devtools/tests/types.spec.ts +19 -0
- package/src/lib/devtools/tests/update-state.spec.ts +29 -0
- package/src/lib/devtools/tests/with-devtools.spec.ts +5 -0
- package/src/lib/devtools/tests/with-glitch-tracking.spec.ts +272 -0
- package/src/lib/devtools/tests/with-mapper.spec.ts +69 -0
- package/src/lib/devtools/update-state.ts +38 -0
- package/{lib/devtools/with-dev-tools-stub.d.ts → src/lib/devtools/with-dev-tools-stub.ts} +2 -1
- package/src/lib/devtools/with-devtools.ts +81 -0
- package/src/lib/flattening-operator.ts +42 -0
- package/src/lib/immutable-state/deep-freeze.ts +43 -0
- package/src/lib/immutable-state/is-dev-mode.ts +6 -0
- package/src/lib/immutable-state/tests/with-immutable-state.spec.ts +260 -0
- package/src/lib/immutable-state/with-immutable-state.ts +115 -0
- package/src/lib/mutation/http-mutation.spec.ts +473 -0
- package/src/lib/mutation/http-mutation.ts +172 -0
- package/src/lib/mutation/mutation.ts +26 -0
- package/src/lib/mutation/rx-mutation.spec.ts +594 -0
- package/src/lib/mutation/rx-mutation.ts +208 -0
- package/src/lib/shared/prettify.ts +3 -0
- package/{lib/shared/signal-store-models.d.ts → src/lib/shared/signal-store-models.ts} +8 -4
- package/src/lib/shared/throw-if-null.ts +7 -0
- package/src/lib/storage-sync/features/with-indexed-db.ts +81 -0
- package/src/lib/storage-sync/features/with-local-storage.ts +58 -0
- package/src/lib/storage-sync/internal/indexeddb.service.ts +124 -0
- package/src/lib/storage-sync/internal/local-storage.service.ts +19 -0
- package/src/lib/storage-sync/internal/models.ts +62 -0
- package/src/lib/storage-sync/internal/session-storage.service.ts +18 -0
- package/src/lib/storage-sync/tests/indexeddb.service.spec.ts +99 -0
- package/src/lib/storage-sync/tests/with-storage-async.spec.ts +308 -0
- package/src/lib/storage-sync/tests/with-storage-sync.spec.ts +268 -0
- package/src/lib/storage-sync/with-storage-sync.ts +233 -0
- package/src/lib/with-call-state.spec.ts +42 -0
- package/src/lib/with-call-state.ts +195 -0
- package/src/lib/with-conditional.spec.ts +125 -0
- package/{lib/with-conditional.d.ts → src/lib/with-conditional.ts} +31 -7
- package/src/lib/with-data-service.spec.ts +564 -0
- package/src/lib/with-data-service.ts +433 -0
- package/src/lib/with-feature-factory.spec.ts +69 -0
- package/{lib/with-feature-factory.d.ts → src/lib/with-feature-factory.ts} +32 -4
- package/src/lib/with-mutations.spec.ts +537 -0
- package/src/lib/with-mutations.ts +146 -0
- package/src/lib/with-pagination.spec.ts +90 -0
- package/src/lib/with-pagination.ts +353 -0
- package/src/lib/with-redux.spec.ts +258 -0
- package/src/lib/with-redux.ts +387 -0
- package/src/lib/with-reset.spec.ts +112 -0
- package/src/lib/with-reset.ts +62 -0
- package/src/lib/with-undo-redo.spec.ts +287 -0
- package/src/lib/with-undo-redo.ts +199 -0
- package/src/test-setup.ts +8 -0
- package/tsconfig.json +29 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +17 -0
- package/fesm2022/angular-architects-ngrx-toolkit-redux-connector.mjs +0 -119
- package/fesm2022/angular-architects-ngrx-toolkit-redux-connector.mjs.map +0 -1
- package/fesm2022/angular-architects-ngrx-toolkit.mjs +0 -1787
- package/fesm2022/angular-architects-ngrx-toolkit.mjs.map +0 -1
- package/lib/assertions/assertions.d.ts +0 -2
- package/lib/devtools/internal/current-action-names.d.ts +0 -1
- package/lib/devtools/internal/default-tracker.d.ts +0 -13
- package/lib/devtools/internal/devtools-feature.d.ts +0 -24
- package/lib/devtools/internal/devtools-syncer.service.d.ts +0 -35
- package/lib/devtools/internal/glitch-tracker.service.d.ts +0 -18
- package/lib/devtools/internal/models.d.ts +0 -24
- package/lib/devtools/rename-devtools-name.d.ts +0 -7
- package/lib/devtools/update-state.d.ts +0 -15
- package/lib/devtools/with-devtools.d.ts +0 -24
- package/lib/immutable-state/deep-freeze.d.ts +0 -11
- package/lib/immutable-state/is-dev-mode.d.ts +0 -1
- package/lib/immutable-state/with-immutable-state.d.ts +0 -60
- package/lib/shared/throw-if-null.d.ts +0 -1
- package/lib/storage-sync/features/with-indexed-db.d.ts +0 -2
- package/lib/storage-sync/features/with-local-storage.d.ts +0 -3
- package/lib/storage-sync/internal/indexeddb.service.d.ts +0 -29
- package/lib/storage-sync/internal/local-storage.service.d.ts +0 -8
- package/lib/storage-sync/internal/models.d.ts +0 -45
- package/lib/storage-sync/internal/session-storage.service.d.ts +0 -8
- package/lib/storage-sync/with-storage-sync.d.ts +0 -45
- package/lib/with-call-state.d.ts +0 -58
- package/lib/with-data-service.d.ts +0 -109
- package/lib/with-pagination.d.ts +0 -98
- package/lib/with-redux.d.ts +0 -147
- package/lib/with-reset.d.ts +0 -29
- package/lib/with-undo-redo.d.ts +0 -31
- package/redux-connector/index.d.ts +0 -2
- package/redux-connector/src/lib/create-redux.d.ts +0 -13
- package/redux-connector/src/lib/model.d.ts +0 -40
- package/redux-connector/src/lib/rxjs-interop/redux-method.d.ts +0 -14
- package/redux-connector/src/lib/signal-redux-store.d.ts +0 -11
- package/redux-connector/src/lib/util.d.ts +0 -5
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { EnvironmentProviders, Signal, Type } from '@angular/core';
|
|
2
|
-
import { DeepSignal } from '@ngrx/signals/src/deep-signal';
|
|
3
|
-
import { SignalStoreFeatureResult, StateSignals } from '@ngrx/signals/src/signal-store-models';
|
|
4
|
-
import { Action, ActionCreator, ActionType, Prettify } from '@ngrx/store/src/models';
|
|
5
|
-
import { Observable, Unsubscribable } from 'rxjs';
|
|
6
|
-
export type IncludePropType<T, V, WithNevers = {
|
|
7
|
-
[K in keyof T]: Exclude<T[K], undefined> extends V ? T[K] extends Record<string, unknown> ? IncludePropType<T[K], V> : T[K] : never;
|
|
8
|
-
}> = Prettify<Pick<WithNevers, {
|
|
9
|
-
[K in keyof WithNevers]: WithNevers[K] extends never ? never : K extends string ? K : never;
|
|
10
|
-
}[keyof WithNevers]>>;
|
|
11
|
-
export type Store = Type<Record<string, unknown> & StateSignals<SignalStoreFeatureResult['state']>>;
|
|
12
|
-
export type CreateReduxState<StoreName extends string, STORE extends Store> = {
|
|
13
|
-
[K in StoreName as `provide${Capitalize<K>}Store`]: (connectReduxDevtools?: boolean) => EnvironmentProviders;
|
|
14
|
-
} & {
|
|
15
|
-
[K in StoreName as `inject${Capitalize<K>}Store`]: () => InjectableReduxSlice<STORE>;
|
|
16
|
-
};
|
|
17
|
-
export type Selectors<STORE extends Store> = IncludePropType<InstanceType<STORE>, Signal<unknown> | DeepSignal<unknown>>;
|
|
18
|
-
export type Dispatch = {
|
|
19
|
-
dispatch: (input: Action | Observable<Action> | Signal<Action>) => Unsubscribable;
|
|
20
|
-
};
|
|
21
|
-
export type InjectableReduxSlice<STORE extends Store> = Selectors<STORE> & Dispatch;
|
|
22
|
-
export type ExtractActionTypes<Creators extends readonly ActionCreator[]> = {
|
|
23
|
-
[Key in keyof Creators]: Creators[Key] extends ActionCreator<infer T> ? T : never;
|
|
24
|
-
};
|
|
25
|
-
export interface ActionMethod<T, V extends Action = Action> {
|
|
26
|
-
(action: V): T;
|
|
27
|
-
}
|
|
28
|
-
export interface StoreMethod<Creators extends readonly ActionCreator[], ResultState = unknown> {
|
|
29
|
-
(action: ActionType<Creators[number]>): ResultState;
|
|
30
|
-
}
|
|
31
|
-
export interface MapperTypes<Creators extends readonly ActionCreator[]> {
|
|
32
|
-
types: ExtractActionTypes<Creators>;
|
|
33
|
-
storeMethod: StoreMethod<Creators>;
|
|
34
|
-
resultMethod?: (...args: unknown[]) => unknown;
|
|
35
|
-
}
|
|
36
|
-
export type ServiceWithDecorator = {
|
|
37
|
-
ɵprov?: {
|
|
38
|
-
providedIn?: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Injector, Signal } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
type RxMethodInput<Input> = Input | Observable<Input> | Signal<Input>;
|
|
4
|
-
type RxMethodRef = {
|
|
5
|
-
destroy: () => void;
|
|
6
|
-
};
|
|
7
|
-
type RxMethod<Input, MethodInput = Input, MethodResult = unknown> = ((input: RxMethodInput<Input>, resultMethod: (input: MethodInput) => MethodResult) => RxMethodRef) & RxMethodRef;
|
|
8
|
-
export declare function reduxMethod<Input, MethodInput = Input>(generator: (source$: Observable<Input>) => Observable<MethodInput>, config?: {
|
|
9
|
-
injector?: Injector;
|
|
10
|
-
}): RxMethod<Input, MethodInput>;
|
|
11
|
-
export declare function reduxMethod<Input, MethodInput = Input, MethodResult = unknown>(generator: (source$: Observable<Input>) => Observable<MethodInput>, resultMethod: (input: MethodInput) => MethodResult, config?: {
|
|
12
|
-
injector?: Injector;
|
|
13
|
-
}): RxMethod<Input, MethodInput, MethodResult>;
|
|
14
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Action, ActionCreator } from '@ngrx/store';
|
|
2
|
-
import { MapperTypes } from './model';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class SignalReduxStore {
|
|
5
|
-
private mapperDict;
|
|
6
|
-
dispatch: import("@ngrx/signals/rxjs-interop").RxMethod<Action<string>>;
|
|
7
|
-
connectFeatureStore(mappers: MapperTypes<ActionCreator<any, any>[]>[]): void;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SignalReduxStore, never>;
|
|
9
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SignalReduxStore>;
|
|
10
|
-
}
|
|
11
|
-
export declare function injectReduxDispatch(): import("@ngrx/signals/rxjs-interop").RxMethod<Action<string>>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ActionCreator } from '@ngrx/store';
|
|
2
|
-
import { Unsubscribable } from 'rxjs';
|
|
3
|
-
export declare function isUnsubscribable<F extends (...args: unknown[]) => unknown>(fn: F | (F & Unsubscribable)): fn is F & Unsubscribable;
|
|
4
|
-
export declare function capitalize(str: string): string;
|
|
5
|
-
export declare function isActionCreator(action: unknown): action is ActionCreator;
|