ngssm-store 19.0.0 → 19.1.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.
@@ -1,6 +1,6 @@
1
1
  import { Action } from 'ngssm-store';
2
2
  import { CachedItem } from '../model';
3
- export declare class SetCachedItemAction<TData = any> implements Action {
3
+ export declare class SetCachedItemAction<TData = never> implements Action {
4
4
  readonly cachedItemKey: string;
5
5
  readonly cachedItem: Partial<CachedItem<TData>>;
6
6
  readonly type: string;
@@ -1,5 +1,5 @@
1
1
  import { CachedItemStatus } from './cached-item-status';
2
- export interface CachedItem<TData = any> {
2
+ export interface CachedItem<TData = unknown> {
3
3
  status: CachedItemStatus;
4
4
  item?: TData;
5
5
  error?: string;
@@ -1,12 +1,10 @@
1
- import { Spec } from 'immutability-helper';
1
+ import { CustomCommands, Spec } from 'immutability-helper';
2
2
  import { State } from 'ngssm-store';
3
3
  import { CachedItem } from '../model';
4
4
  export declare const selectNgssmCachingState: (state: State) => NgssmCachingState;
5
- export declare const updateNgssmCachingState: (state: State, command: Spec<NgssmCachingState, never>) => State;
5
+ export declare const updateNgssmCachingState: <T extends CustomCommands<object> = never>(state: State, command: Spec<NgssmCachingState, T>) => State;
6
6
  export interface NgssmCachingState {
7
- caches: {
8
- [key: string]: CachedItem;
9
- };
7
+ caches: Record<string, CachedItem>;
10
8
  }
11
9
  export declare class NgssmCachingStateSpecification {
12
10
  static readonly featureStateKey = "ngssm-caching-state";
@@ -1,3 +1,3 @@
1
1
  import { State } from 'ngssm-store';
2
2
  import { CachedItem } from '../model';
3
- export declare const selectNgssmCachedItem: <T>(state: State, key: string) => CachedItem<T> | undefined;
3
+ export declare const selectNgssmCachedItem: <T = unknown>(state: State, key: string) => CachedItem<T> | undefined;
@@ -89,10 +89,10 @@ class CachedItemReducer {
89
89
  }
90
90
  return state;
91
91
  }
92
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CachedItemReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CachedItemReducer }); }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CachedItemReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CachedItemReducer }); }
94
94
  }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CachedItemReducer, decorators: [{
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CachedItemReducer, decorators: [{
96
96
  type: Injectable
97
97
  }] });
98
98
 
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-store-caching.mjs","sources":["../../../projects/ngssm-store/caching/src/actions/ngssm-caching-action-type.ts","../../../projects/ngssm-store/caching/src/actions/set-cached-item.action.ts","../../../projects/ngssm-store/caching/src/actions/unset-cached-item.action.ts","../../../projects/ngssm-store/caching/src/state/ngssm-caching.state.ts","../../../projects/ngssm-store/caching/src/state/selectors.ts","../../../projects/ngssm-store/caching/src/model/cached-item-status.ts","../../../projects/ngssm-store/caching/src/reducers/cached-item.reducer.ts","../../../projects/ngssm-store/caching/src/provide-ngssm-caching.ts","../../../projects/ngssm-store/caching/ngssm-store-caching.ts"],"sourcesContent":["export enum NgssmCachingActionType {\n setCachedItem = '[NgssmCachingActionType] setCachedItem',\n unsetCachedItem = '[NgssmCachingActionType] unsetCachedItem'\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\nimport { CachedItem } from '../model';\n\nexport class SetCachedItemAction<TData = any> implements Action {\n public readonly type: string = NgssmCachingActionType.setCachedItem;\n\n constructor(\n public readonly cachedItemKey: string,\n public readonly cachedItem: Partial<CachedItem<TData>>\n ) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\n\nexport class UnsetCachedItemAction implements Action {\n public readonly type: string = NgssmCachingActionType.unsetCachedItem;\n\n constructor(public readonly cachedItemKey: string) {}\n}\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\nimport { CachedItem } from '../model';\n\nexport const selectNgssmCachingState = (state: State): NgssmCachingState =>\n state[NgssmCachingStateSpecification.featureStateKey] as NgssmCachingState;\n\nexport const updateNgssmCachingState = (state: State, command: Spec<NgssmCachingState, never>): State =>\n update(state, {\n [NgssmCachingStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmCachingState {\n caches: { [key: string]: CachedItem };\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmCachingStateSpecification.featureStateKey,\n initialState: NgssmCachingStateSpecification.initialState\n})\nexport class NgssmCachingStateSpecification {\n public static readonly featureStateKey = 'ngssm-caching-state';\n public static readonly initialState: NgssmCachingState = {\n caches: {}\n };\n}\n","import { State } from 'ngssm-store';\nimport { CachedItem } from '../model';\nimport { selectNgssmCachingState } from './ngssm-caching.state';\n\nexport const selectNgssmCachedItem = <T>(state: State, key: string): CachedItem<T> | undefined =>\n selectNgssmCachingState(state).caches[key];\n","export enum CachedItemStatus {\n notSet = 'Not Set',\n loading = 'Loading',\n set = 'Set',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType, SetCachedItemAction, UnsetCachedItemAction } from '../actions';\nimport { selectNgssmCachedItem, updateNgssmCachingState } from '../state';\nimport { CachedItem, CachedItemStatus } from '../model';\n\n@Injectable()\nexport class CachedItemReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmCachingActionType.setCachedItem, NgssmCachingActionType.unsetCachedItem];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmCachingActionType.setCachedItem: {\n const setCachedItemAction = action as SetCachedItemAction;\n if (selectNgssmCachedItem(state, setCachedItemAction.cachedItemKey) === undefined) {\n const cachedItem: CachedItem = {\n status: CachedItemStatus.notSet,\n ...setCachedItemAction.cachedItem\n };\n return updateNgssmCachingState(state, {\n caches: {\n [setCachedItemAction.cachedItemKey]: { $set: cachedItem }\n }\n });\n }\n\n return updateNgssmCachingState(state, {\n caches: {\n [setCachedItemAction.cachedItemKey]: { $merge: setCachedItemAction.cachedItem }\n }\n });\n }\n\n case NgssmCachingActionType.unsetCachedItem: {\n const unsetCachedItemAction = action as UnsetCachedItemAction;\n if (selectNgssmCachedItem(state, unsetCachedItemAction.cachedItemKey) === undefined) {\n return state;\n }\n\n return updateNgssmCachingState(state, {\n caches: { $unset: [unsetCachedItemAction.cachedItemKey] }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { CachedItemReducer } from './reducers';\n\nexport const provideNgssmCaching = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(CachedItemReducer)]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;IAAY;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,eAAA,CAAA,GAAA,wCAAwD;AACxD,IAAA,sBAAA,CAAA,iBAAA,CAAA,GAAA,0CAA4D;AAC9D,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAGjC,EAAA,CAAA,CAAA;;MCEY,mBAAmB,CAAA;IAG9B,WACkB,CAAA,aAAqB,EACrB,UAAsC,EAAA;QADtC,IAAa,CAAA,aAAA,GAAb,aAAa;QACb,IAAU,CAAA,UAAA,GAAV,UAAU;AAJZ,QAAA,IAAA,CAAA,IAAI,GAAW,sBAAsB,CAAC,aAAa;;AAMpE;;MCTY,qBAAqB,CAAA;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UAAA,EAAA,CAAA;kBAD7B;;;ACJM,MAAM,mBAAmB,GAAG,MAA2B;IAC5D,OAAO,wBAAwB,CAAC,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACvE;;ACNA;;AAEG;;;;"}
1
+ {"version":3,"file":"ngssm-store-caching.mjs","sources":["../../../projects/ngssm-store/caching/src/actions/ngssm-caching-action-type.ts","../../../projects/ngssm-store/caching/src/actions/set-cached-item.action.ts","../../../projects/ngssm-store/caching/src/actions/unset-cached-item.action.ts","../../../projects/ngssm-store/caching/src/state/ngssm-caching.state.ts","../../../projects/ngssm-store/caching/src/state/selectors.ts","../../../projects/ngssm-store/caching/src/model/cached-item-status.ts","../../../projects/ngssm-store/caching/src/reducers/cached-item.reducer.ts","../../../projects/ngssm-store/caching/src/provide-ngssm-caching.ts","../../../projects/ngssm-store/caching/ngssm-store-caching.ts"],"sourcesContent":["export enum NgssmCachingActionType {\n setCachedItem = '[NgssmCachingActionType] setCachedItem',\n unsetCachedItem = '[NgssmCachingActionType] unsetCachedItem'\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\nimport { CachedItem } from '../model';\n\nexport class SetCachedItemAction<TData = never> implements Action {\n public readonly type: string = NgssmCachingActionType.setCachedItem;\n\n constructor(\n public readonly cachedItemKey: string,\n public readonly cachedItem: Partial<CachedItem<TData>>\n ) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\n\nexport class UnsetCachedItemAction implements Action {\n public readonly type: string = NgssmCachingActionType.unsetCachedItem;\n\n constructor(public readonly cachedItemKey: string) {}\n}\n","import update, { CustomCommands, Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\nimport { CachedItem } from '../model';\n\nexport const selectNgssmCachingState = (state: State): NgssmCachingState =>\n state[NgssmCachingStateSpecification.featureStateKey] as NgssmCachingState;\n\nexport const updateNgssmCachingState = <T extends CustomCommands<object> = never>(state: State, command: Spec<NgssmCachingState, T>): State =>\n update(state, {\n [NgssmCachingStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmCachingState {\n caches: Record<string, CachedItem>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmCachingStateSpecification.featureStateKey,\n initialState: NgssmCachingStateSpecification.initialState\n})\nexport class NgssmCachingStateSpecification {\n public static readonly featureStateKey = 'ngssm-caching-state';\n public static readonly initialState: NgssmCachingState = {\n caches: {}\n };\n}\n","import { State } from 'ngssm-store';\nimport { CachedItem } from '../model';\nimport { selectNgssmCachingState } from './ngssm-caching.state';\n\nexport const selectNgssmCachedItem = <T = unknown>(state: State, key: string): CachedItem<T> | undefined =>\n selectNgssmCachingState(state).caches[key] as CachedItem<T>;\n","export enum CachedItemStatus {\n notSet = 'Not Set',\n loading = 'Loading',\n set = 'Set',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType, SetCachedItemAction, UnsetCachedItemAction } from '../actions';\nimport { selectNgssmCachedItem, updateNgssmCachingState } from '../state';\nimport { CachedItem, CachedItemStatus } from '../model';\n\n@Injectable()\nexport class CachedItemReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmCachingActionType.setCachedItem, NgssmCachingActionType.unsetCachedItem];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmCachingActionType.setCachedItem: {\n const setCachedItemAction = action as SetCachedItemAction;\n if (selectNgssmCachedItem(state, setCachedItemAction.cachedItemKey) === undefined) {\n const cachedItem: CachedItem = {\n status: CachedItemStatus.notSet,\n ...setCachedItemAction.cachedItem\n };\n return updateNgssmCachingState(state, {\n caches: {\n [setCachedItemAction.cachedItemKey]: { $set: cachedItem }\n }\n });\n }\n\n return updateNgssmCachingState(state, {\n caches: {\n [setCachedItemAction.cachedItemKey]: { $merge: setCachedItemAction.cachedItem }\n }\n });\n }\n\n case NgssmCachingActionType.unsetCachedItem: {\n const unsetCachedItemAction = action as UnsetCachedItemAction;\n if (selectNgssmCachedItem(state, unsetCachedItemAction.cachedItemKey) === undefined) {\n return state;\n }\n\n return updateNgssmCachingState(state, {\n caches: { $unset: [unsetCachedItemAction.cachedItemKey] }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { CachedItemReducer } from './reducers';\n\nexport const provideNgssmCaching = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(CachedItemReducer)]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;IAAY;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,eAAA,CAAA,GAAA,wCAAwD;AACxD,IAAA,sBAAA,CAAA,iBAAA,CAAA,GAAA,0CAA4D;AAC9D,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAGjC,EAAA,CAAA,CAAA;;MCEY,mBAAmB,CAAA;IAG9B,WACkB,CAAA,aAAqB,EACrB,UAAsC,EAAA;QADtC,IAAa,CAAA,aAAA,GAAb,aAAa;QACb,IAAU,CAAA,UAAA,GAAV,UAAU;AAJZ,QAAA,IAAA,CAAA,IAAI,GAAW,sBAAsB,CAAC,aAAa;;AAMpE;;MCTY,qBAAqB,CAAA;AAGhC,IAAA,WAAA,CAA4B,aAAqB,EAAA;QAArB,IAAa,CAAA,aAAA,GAAb,aAAa;AAFzB,QAAA,IAAA,CAAA,IAAI,GAAW,sBAAsB,CAAC,eAAe;;AAGtE;;ACFM,MAAM,uBAAuB,GAAG,CAAC,KAAY,KAClD,KAAK,CAAC,8BAA8B,CAAC,eAAe;AAE/C,MAAM,uBAAuB,GAAG,CAA2C,KAAY,EAAE,OAAmC,KACjI,MAAM,CAAC,KAAK,EAAE;AACZ,IAAA,CAAC,8BAA8B,CAAC,eAAe,GAAG;AACnD,CAAA;AAUU,IAAA,8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mBAAmB,CAAC;qBACxB;oBACD,OAAO,uBAAuB,CAAC,KAAK,EAAE;AACpC,wBAAA,MAAM,EAAE;4BACN,CAAC,mBAAmB,CAAC,aAAa,GAAG,EAAE,IAAI,EAAE,UAAU;AACxD;AACF,qBAAA,CAAC;;gBAGJ,OAAO,uBAAuB,CAAC,KAAK,EAAE;AACpC,oBAAA,MAAM,EAAE;wBACN,CAAC,mBAAmB,CAAC,aAAa,GAAG,EAAE,MAAM,EAAE,mBAAmB,CAAC,UAAU;AAC9E;AACF,iBAAA,CAAC;;AAGJ,YAAA,KAAK,sBAAsB,CAAC,eAAe,EAAE;gBAC3C,MAAM,qBAAqB,GAAG,MAA+B;gBAC7D,IAAI,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,KAAK,SAAS,EAAE;AACnF,oBAAA,OAAO,KAAK;;gBAGd,OAAO,uBAAuB,CAAC,KAAK,EAAE;oBACpC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC;AACxD,iBAAA,CAAC;;;AAIN,QAAA,OAAO,KAAK;;8GAtCH,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;ACJM,MAAM,mBAAmB,GAAG,MAA2B;IAC5D,OAAO,wBAAwB,CAAC,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACvE;;ACNA;;AAEG;;;;"}
@@ -16,8 +16,12 @@ class StoreMock {
16
16
  get stateValue() {
17
17
  return this._stateValue;
18
18
  }
19
- dispatchAction(action) { }
20
- dispatchActionType(type) { }
19
+ dispatchAction(action) {
20
+ console.log('[StoreMock - dispatchAction]', action);
21
+ }
22
+ dispatchActionType(type) {
23
+ console.log('[StoreMock - dispatchActionType]', type);
24
+ }
21
25
  }
22
26
 
23
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-store-testing.mjs","sources":["../../../projects/ngssm-store/testing/src/store-mock.ts","../../../projects/ngssm-store/testing/ngssm-store-testing.ts"],"sourcesContent":["import { signal } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { Action, State } from 'ngssm-store';\n\nexport class StoreMock {\n private _stateValue: State = {};\n public state$ = new BehaviorSubject<State>(this._stateValue);\n public state = signal<State>(this._stateValue);\n\n constructor(initialState: State) {\n this.stateValue = initialState;\n }\n\n public set stateValue(value: State) {\n this._stateValue = value;\n this.state$.next(value);\n this.state.set(value);\n }\n\n public get stateValue(): State {\n return this._stateValue;\n }\n\n public dispatchAction(action: Action): void {}\n\n public dispatchActionType(type: string): void {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAKa,SAAS,CAAA;AAKpB,IAAA,WAAA,CAAY,YAAmB,EAAA;QAJvB,IAAW,CAAA,WAAA,GAAU,EAAE;QACxB,IAAM,CAAA,MAAA,GAAG,IAAI,eAAe,CAAQ,IAAI,CAAC,WAAW,CAAC;AACrD,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAQ,IAAI,CAAC,WAAW,CAAC;AAG5C,QAAA,IAAI,CAAC,UAAU,GAAG,YAAY;;IAGhC,IAAW,UAAU,CAAC,KAAY,EAAA;AAChC,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;;AAGvB,IAAA,IAAW,UAAU,GAAA;QACnB,OAAO,IAAI,CAAC,WAAW;;IAGlB,cAAc,CAAC,MAAc,EAAA;IAE7B,kBAAkB,CAAC,IAAY,EAAA;AACvC;;AC3BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngssm-store-testing.mjs","sources":["../../../projects/ngssm-store/testing/src/store-mock.ts","../../../projects/ngssm-store/testing/ngssm-store-testing.ts"],"sourcesContent":["import { signal } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { Action, State } from 'ngssm-store';\n\nexport class StoreMock {\n private _stateValue: State = {};\n public state$ = new BehaviorSubject<State>(this._stateValue);\n public state = signal<State>(this._stateValue);\n\n constructor(initialState: State) {\n this.stateValue = initialState;\n }\n\n public set stateValue(value: State) {\n this._stateValue = value;\n this.state$.next(value);\n this.state.set(value);\n }\n\n public get stateValue(): State {\n return this._stateValue;\n }\n\n public dispatchAction(action: Action): void {\n console.log('[StoreMock - dispatchAction]', action);\n }\n\n public dispatchActionType(type: string): void {\n console.log('[StoreMock - dispatchActionType]', type);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAKa,SAAS,CAAA;AAKpB,IAAA,WAAA,CAAY,YAAmB,EAAA;QAJvB,IAAW,CAAA,WAAA,GAAU,EAAE;QACxB,IAAM,CAAA,MAAA,GAAG,IAAI,eAAe,CAAQ,IAAI,CAAC,WAAW,CAAC;AACrD,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAQ,IAAI,CAAC,WAAW,CAAC;AAG5C,QAAA,IAAI,CAAC,UAAU,GAAG,YAAY;;IAGhC,IAAW,UAAU,CAAC,KAAY,EAAA;AAChC,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;;AAGvB,IAAA,IAAW,UAAU,GAAA;QACnB,OAAO,IAAI,CAAC,WAAW;;AAGlB,IAAA,cAAc,CAAC,MAAc,EAAA;AAClC,QAAA,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,MAAM,CAAC;;AAG9C,IAAA,kBAAkB,CAAC,IAAY,EAAA;AACpC,QAAA,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,IAAI,CAAC;;AAExD;;AC/BD;;AAEG;;;;"}
@@ -113,7 +113,7 @@ class VisibilityReducer {
113
113
  }
114
114
  groupExists(keys, groups) {
115
115
  const index = groups.findIndex((group) => {
116
- group.length === keys.length && group.findIndex((k, i) => k !== keys[i]) === -1;
116
+ return group.length === keys.length && group.findIndex((k, i) => k !== keys[i]) === -1;
117
117
  });
118
118
  return index !== -1;
119
119
  }
@@ -135,10 +135,10 @@ class VisibilityReducer {
135
135
  elements: elementsCommand
136
136
  });
137
137
  }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VisibilityReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
139
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VisibilityReducer }); }
138
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: VisibilityReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
139
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: VisibilityReducer }); }
140
140
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VisibilityReducer, decorators: [{
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: VisibilityReducer, decorators: [{
142
142
  type: Injectable
143
143
  }] });
144
144
 
@@ -157,10 +157,10 @@ class ToggleElementVisibilityDirective {
157
157
  this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));
158
158
  }
159
159
  }
160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ToggleElementVisibilityDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
161
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: ToggleElementVisibilityDirective, isStandalone: true, selector: "[toggleElementVisibility]", inputs: { key: ["toggleElementVisibility", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ToggleElementVisibilityDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
161
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: ToggleElementVisibilityDirective, isStandalone: true, selector: "[toggleElementVisibility]", inputs: { key: ["toggleElementVisibility", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
162
162
  }
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ToggleElementVisibilityDirective, decorators: [{
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ToggleElementVisibilityDirective, decorators: [{
164
164
  type: Directive,
165
165
  args: [{
166
166
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -179,10 +179,10 @@ class IsElementVisiblePipe {
179
179
  transform(value, ...args) {
180
180
  return selectNgssmVisibilityState(value).elements[args[0]] === true;
181
181
  }
182
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: IsElementVisiblePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
183
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: IsElementVisiblePipe, isStandalone: true, name: "isElementVisible" }); }
182
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: IsElementVisiblePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
183
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: IsElementVisiblePipe, isStandalone: true, name: "isElementVisible" }); }
184
184
  }
185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: IsElementVisiblePipe, decorators: [{
185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: IsElementVisiblePipe, decorators: [{
186
186
  type: Pipe,
187
187
  args: [{
188
188
  name: 'isElementVisible',
@@ -201,10 +201,10 @@ class ShowElementDirective {
201
201
  this.store.dispatchAction(new ShowElementAction(elementKey));
202
202
  }
203
203
  }
204
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ShowElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
205
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: ShowElementDirective, isStandalone: true, selector: "[showElement]", inputs: { key: ["showElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
204
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ShowElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
205
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: ShowElementDirective, isStandalone: true, selector: "[showElement]", inputs: { key: ["showElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
206
206
  }
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ShowElementDirective, decorators: [{
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ShowElementDirective, decorators: [{
208
208
  type: Directive,
209
209
  args: [{
210
210
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -230,10 +230,10 @@ class HideElementDirective {
230
230
  this.store.dispatchAction(new HideElementAction(elementKey));
231
231
  }
232
232
  }
233
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: HideElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
234
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: HideElementDirective, isStandalone: true, selector: "[hideElement]", inputs: { key: ["hideElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
233
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: HideElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
234
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: HideElementDirective, isStandalone: true, selector: "[hideElement]", inputs: { key: ["hideElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
235
235
  }
236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: HideElementDirective, decorators: [{
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: HideElementDirective, decorators: [{
237
237
  type: Directive,
238
238
  args: [{
239
239
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -254,10 +254,10 @@ class VisibilityToggleGroupComponent extends NgSsmComponent {
254
254
  this.items = [];
255
255
  this.hideMultipleSelectionIndicator = false;
256
256
  }
257
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VisibilityToggleGroupComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
258
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.0.0", type: VisibilityToggleGroupComponent, isStandalone: true, selector: "ngssm-visibility-toggle-group", inputs: { items: "items", hideMultipleSelectionIndicator: ["hideMultipleSelectionIndicator", "hideMultipleSelectionIndicator", booleanAttribute] }, usesInheritance: true, ngImport: i0, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-button-toggle-group>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i3.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: ToggleElementVisibilityDirective, selector: "[toggleElementVisibility]", inputs: ["toggleElementVisibility"] }, { kind: "pipe", type: IsElementVisiblePipe, name: "isElementVisible" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
257
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: VisibilityToggleGroupComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
258
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.1.4", type: VisibilityToggleGroupComponent, isStandalone: true, selector: "ngssm-visibility-toggle-group", inputs: { items: "items", hideMultipleSelectionIndicator: ["hideMultipleSelectionIndicator", "hideMultipleSelectionIndicator", booleanAttribute] }, usesInheritance: true, ngImport: i0, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-button-toggle-group>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i3.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: ToggleElementVisibilityDirective, selector: "[toggleElementVisibility]", inputs: ["toggleElementVisibility"] }, { kind: "pipe", type: IsElementVisiblePipe, name: "isElementVisible" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
259
259
  }
260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VisibilityToggleGroupComponent, decorators: [{
260
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: VisibilityToggleGroupComponent, decorators: [{
261
261
  type: Component,
262
262
  args: [{ selector: 'ngssm-visibility-toggle-group', imports: [CommonModule, MatButtonToggleModule, ToggleElementVisibilityDirective, IsElementVisiblePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-button-toggle-group>" }]
263
263
  }], ctorParameters: () => [{ type: i1.Store }], propDecorators: { items: [{
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-store-visibility.mjs","sources":["../../../projects/ngssm-store/visibility/src/actions/ngssm-visibility-action-type.ts","../../../projects/ngssm-store/visibility/src/actions/toggle-element-visibility.action.ts","../../../projects/ngssm-store/visibility/src/actions/show-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/hide-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/define-elements-group.action.ts","../../../projects/ngssm-store/visibility/src/state/ngssm-visibility.state.ts","../../../projects/ngssm-store/visibility/src/reducers/visibility.reducer.ts","../../../projects/ngssm-store/visibility/src/provide-ngssm-visibility.ts","../../../projects/ngssm-store/visibility/src/components/toggle-element-visibility.directive.ts","../../../projects/ngssm-store/visibility/src/components/is-element-visible.pipe.ts","../../../projects/ngssm-store/visibility/src/components/show-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/hide-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.html","../../../projects/ngssm-store/visibility/ngssm-store-visibility.ts"],"sourcesContent":["export enum NgssmVisibilityActionType {\n defineElementsGroup = '[NgssmVisibilityActionType] defineElementsGroup',\n toggleElementVisibility = '[NgssmVisibilityActionType] toggleElementVisibility',\n hideElement = '[NgssmVisibilityActionType] hideElement',\n showElement = '[NgssmVisibilityActionType] showElement'\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ToggleElementVisibilityAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.toggleElementVisibility;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ShowElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.showElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class HideElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.hideElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class DefineElementsGroupAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.defineElementsGroup;\n\n constructor(public readonly elementKeys: string[]) {}\n}\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNgssmVisibilityState = (state: State): NgssmVisibilityState =>\n state[NgssmVisibilityStateSpecification.featureStateKey] as NgssmVisibilityState;\n\nexport const updateNgssmVisibilityState = (state: State, command: Spec<NgssmVisibilityState, never>): State =>\n update(state, {\n [NgssmVisibilityStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmVisibilityState {\n elements: { [key: string]: boolean };\n elementsGroups: string[][];\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmVisibilityStateSpecification.featureStateKey,\n initialState: NgssmVisibilityStateSpecification.initialState\n})\nexport class NgssmVisibilityStateSpecification {\n public static readonly featureStateKey = 'ngssm-visibility-state';\n public static readonly initialState: NgssmVisibilityState = {\n elements: {},\n elementsGroups: []\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { Spec } from 'immutability-helper';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n DefineElementsGroupAction,\n HideElementAction,\n NgssmVisibilityActionType,\n ShowElementAction,\n ToggleElementVisibilityAction\n} from '../actions';\nimport { selectNgssmVisibilityState, updateNgssmVisibilityState } from '../state';\n\n@Injectable()\nexport class VisibilityReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmVisibilityActionType.toggleElementVisibility,\n NgssmVisibilityActionType.showElement,\n NgssmVisibilityActionType.hideElement,\n NgssmVisibilityActionType.defineElementsGroup\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmVisibilityActionType.toggleElementVisibility: {\n const toggleVisibilityAction = action as ToggleElementVisibilityAction;\n if (selectNgssmVisibilityState(state).elements[toggleVisibilityAction.elementKey] === true) {\n return updateNgssmVisibilityState(state, {\n elements: {\n [toggleVisibilityAction.elementKey]: { $set: false }\n }\n });\n }\n\n return this.setElementVisible(state, toggleVisibilityAction.elementKey);\n }\n\n case NgssmVisibilityActionType.showElement: {\n const showAction = action as ShowElementAction;\n return this.setElementVisible(state, showAction.elementKey);\n }\n\n case NgssmVisibilityActionType.hideElement: {\n const hideAction = action as HideElementAction;\n return updateNgssmVisibilityState(state, {\n elements: {\n [hideAction.elementKey]: { $set: false }\n }\n });\n }\n\n case NgssmVisibilityActionType.defineElementsGroup: {\n const defineElementsGroupAction = action as DefineElementsGroupAction;\n const keys = [...defineElementsGroupAction.elementKeys];\n keys.sort();\n if (this.groupExists(keys, selectNgssmVisibilityState(state).elementsGroups)) {\n break;\n }\n\n return updateNgssmVisibilityState(state, {\n elementsGroups: { $push: [keys] }\n });\n }\n }\n\n return state;\n }\n\n private groupExists(keys: string[], groups: string[][]): boolean {\n const index = groups.findIndex((group) => {\n group.length === keys.length && group.findIndex((k, i) => k !== keys[i]) === -1;\n });\n return index !== -1;\n }\n\n private getElementsKeysGroupedWith(key: string, groups: string[][]): string[] {\n const keys = groups.filter((g) => g.includes(key)).flatMap((g) => g);\n const distinctKeys = new Set<string>(keys);\n distinctKeys.delete(key);\n return [...distinctKeys];\n }\n\n private setElementVisible(state: State, key: string): State {\n const elementsCommand: Spec<{ [key: string]: boolean }, never> = {\n [key]: { $set: true }\n };\n\n const associatedElements = this.getElementsKeysGroupedWith(key, selectNgssmVisibilityState(state).elementsGroups);\n associatedElements.forEach((el) => {\n elementsCommand[el] = { $set: false };\n });\n\n return updateNgssmVisibilityState(state, {\n elements: elementsCommand\n });\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { VisibilityReducer } from './reducers';\n\nexport const provideNgssmVisibility = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(VisibilityReducer)]);\n};\n","import { Directive, HostListener, Input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[toggleElementVisibility]',\n standalone: true\n})\nexport class ToggleElementVisibilityDirective {\n @Input('toggleElementVisibility') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { State } from 'ngssm-store';\nimport { selectNgssmVisibilityState } from '../state';\n\n@Pipe({\n name: 'isElementVisible',\n standalone: true\n})\nexport class IsElementVisiblePipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n return selectNgssmVisibilityState(value).elements[args[0]] === true;\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { ShowElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[showElement]',\n standalone: true\n})\nexport class ShowElementDirective {\n @Input('showElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ShowElementAction(elementKey));\n }\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { HideElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[hideElement]',\n standalone: true\n})\nexport class HideElementDirective {\n @Input('hideElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new HideElementAction(elementKey));\n }\n }\n}\n","import { Component, ChangeDetectionStrategy, Input, booleanAttribute } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\n\nimport { NgSsmComponent, Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityDirective } from '../toggle-element-visibility.directive';\nimport { IsElementVisiblePipe } from '../is-element-visible.pipe';\n\n@Component({\n selector: 'ngssm-visibility-toggle-group',\n imports: [CommonModule, MatButtonToggleModule, ToggleElementVisibilityDirective, IsElementVisiblePipe],\n templateUrl: './visibility-toggle-group.component.html',\n styleUrls: [],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class VisibilityToggleGroupComponent extends NgSsmComponent {\n @Input() public items: { label: string; key: string }[] = [];\n @Input({ transform: booleanAttribute }) hideMultipleSelectionIndicator = false;\n\n constructor(store: Store) {\n super(store);\n }\n}\n","<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-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AAA,EAAA,WAAA,EAAA,IAAA,EAAE,gCAAgC,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,oBAAoB,EAAA,IAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAK1F,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAP1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,EAChC,OAAA,EAAA,CAAC,YAAY,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,oBAAoB,CAAC,EAGrF,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,iXAAA,EAAA;0EAG/B,KAAK,EAAA,CAAA;sBAApB;gBACuC,8BAA8B,EAAA,CAAA;sBAArE,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;;AElBxC;;AAEG;;;;"}
1
+ {"version":3,"file":"ngssm-store-visibility.mjs","sources":["../../../projects/ngssm-store/visibility/src/actions/ngssm-visibility-action-type.ts","../../../projects/ngssm-store/visibility/src/actions/toggle-element-visibility.action.ts","../../../projects/ngssm-store/visibility/src/actions/show-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/hide-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/define-elements-group.action.ts","../../../projects/ngssm-store/visibility/src/state/ngssm-visibility.state.ts","../../../projects/ngssm-store/visibility/src/reducers/visibility.reducer.ts","../../../projects/ngssm-store/visibility/src/provide-ngssm-visibility.ts","../../../projects/ngssm-store/visibility/src/components/toggle-element-visibility.directive.ts","../../../projects/ngssm-store/visibility/src/components/is-element-visible.pipe.ts","../../../projects/ngssm-store/visibility/src/components/show-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/hide-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.html","../../../projects/ngssm-store/visibility/ngssm-store-visibility.ts"],"sourcesContent":["export enum NgssmVisibilityActionType {\n defineElementsGroup = '[NgssmVisibilityActionType] defineElementsGroup',\n toggleElementVisibility = '[NgssmVisibilityActionType] toggleElementVisibility',\n hideElement = '[NgssmVisibilityActionType] hideElement',\n showElement = '[NgssmVisibilityActionType] showElement'\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ToggleElementVisibilityAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.toggleElementVisibility;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ShowElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.showElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class HideElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.hideElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class DefineElementsGroupAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.defineElementsGroup;\n\n constructor(public readonly elementKeys: string[]) {}\n}\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNgssmVisibilityState = (state: State): NgssmVisibilityState =>\n state[NgssmVisibilityStateSpecification.featureStateKey] as NgssmVisibilityState;\n\nexport const updateNgssmVisibilityState = (state: State, command: Spec<NgssmVisibilityState, never>): State =>\n update(state, {\n [NgssmVisibilityStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmVisibilityState {\n elements: Record<string, boolean>;\n elementsGroups: string[][];\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmVisibilityStateSpecification.featureStateKey,\n initialState: NgssmVisibilityStateSpecification.initialState\n})\nexport class NgssmVisibilityStateSpecification {\n public static readonly featureStateKey = 'ngssm-visibility-state';\n public static readonly initialState: NgssmVisibilityState = {\n elements: {},\n elementsGroups: []\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { Spec } from 'immutability-helper';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n DefineElementsGroupAction,\n HideElementAction,\n NgssmVisibilityActionType,\n ShowElementAction,\n ToggleElementVisibilityAction\n} from '../actions';\nimport { selectNgssmVisibilityState, updateNgssmVisibilityState } from '../state';\n\n@Injectable()\nexport class VisibilityReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmVisibilityActionType.toggleElementVisibility,\n NgssmVisibilityActionType.showElement,\n NgssmVisibilityActionType.hideElement,\n NgssmVisibilityActionType.defineElementsGroup\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmVisibilityActionType.toggleElementVisibility: {\n const toggleVisibilityAction = action as ToggleElementVisibilityAction;\n if (selectNgssmVisibilityState(state).elements[toggleVisibilityAction.elementKey] === true) {\n return updateNgssmVisibilityState(state, {\n elements: {\n [toggleVisibilityAction.elementKey]: { $set: false }\n }\n });\n }\n\n return this.setElementVisible(state, toggleVisibilityAction.elementKey);\n }\n\n case NgssmVisibilityActionType.showElement: {\n const showAction = action as ShowElementAction;\n return this.setElementVisible(state, showAction.elementKey);\n }\n\n case NgssmVisibilityActionType.hideElement: {\n const hideAction = action as HideElementAction;\n return updateNgssmVisibilityState(state, {\n elements: {\n [hideAction.elementKey]: { $set: false }\n }\n });\n }\n\n case NgssmVisibilityActionType.defineElementsGroup: {\n const defineElementsGroupAction = action as DefineElementsGroupAction;\n const keys = [...defineElementsGroupAction.elementKeys];\n keys.sort();\n if (this.groupExists(keys, selectNgssmVisibilityState(state).elementsGroups)) {\n break;\n }\n\n return updateNgssmVisibilityState(state, {\n elementsGroups: { $push: [keys] }\n });\n }\n }\n\n return state;\n }\n\n private groupExists(keys: string[], groups: string[][]): boolean {\n const index = groups.findIndex((group) => {\n return group.length === keys.length && group.findIndex((k, i) => k !== keys[i]) === -1;\n });\n return index !== -1;\n }\n\n private getElementsKeysGroupedWith(key: string, groups: string[][]): string[] {\n const keys = groups.filter((g) => g.includes(key)).flatMap((g) => g);\n const distinctKeys = new Set<string>(keys);\n distinctKeys.delete(key);\n return [...distinctKeys];\n }\n\n private setElementVisible(state: State, key: string): State {\n const elementsCommand: Spec<Record<string, boolean>, never> = {\n [key]: { $set: true }\n };\n\n const associatedElements = this.getElementsKeysGroupedWith(key, selectNgssmVisibilityState(state).elementsGroups);\n associatedElements.forEach((el) => {\n elementsCommand[el] = { $set: false };\n });\n\n return updateNgssmVisibilityState(state, {\n elements: elementsCommand\n });\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { VisibilityReducer } from './reducers';\n\nexport const provideNgssmVisibility = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(VisibilityReducer)]);\n};\n","import { Directive, HostListener, Input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[toggleElementVisibility]',\n standalone: true\n})\nexport class ToggleElementVisibilityDirective {\n @Input('toggleElementVisibility') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { State } from 'ngssm-store';\nimport { selectNgssmVisibilityState } from '../state';\n\n@Pipe({\n name: 'isElementVisible',\n standalone: true\n})\nexport class IsElementVisiblePipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n return selectNgssmVisibilityState(value).elements[args[0]] === true;\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { ShowElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[showElement]',\n standalone: true\n})\nexport class ShowElementDirective {\n @Input('showElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ShowElementAction(elementKey));\n }\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { HideElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[hideElement]',\n standalone: true\n})\nexport class HideElementDirective {\n @Input('hideElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new HideElementAction(elementKey));\n }\n }\n}\n","import { Component, ChangeDetectionStrategy, Input, booleanAttribute } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\n\nimport { NgSsmComponent, Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityDirective } from '../toggle-element-visibility.directive';\nimport { IsElementVisiblePipe } from '../is-element-visible.pipe';\n\n@Component({\n selector: 'ngssm-visibility-toggle-group',\n imports: [CommonModule, MatButtonToggleModule, ToggleElementVisibilityDirective, IsElementVisiblePipe],\n templateUrl: './visibility-toggle-group.component.html',\n styleUrls: [],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class VisibilityToggleGroupComponent extends NgSsmComponent {\n @Input() public items: { label: string; key: string }[] = [];\n @Input({ transform: booleanAttribute }) hideMultipleSelectionIndicator = false;\n\n constructor(store: Store) {\n super(store);\n }\n}\n","<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-button-toggle-group>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,yBAAyB,EAAA;AACnC,IAAA,yBAAA,CAAA,qBAAA,CAAA,GAAA,iDAAuE;AACvE,IAAA,yBAAA,CAAA,yBAAA,CAAA,GAAA,qDAA+E;AAC/E,IAAA,yBAAA,CAAA,aAAA,CAAA,GAAA,yCAAuD;AACvD,IAAA,yBAAA,CAAA,aAAA,CAAA,GAAA,yCAAuD;AACzD,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,GAKpC,EAAA,CAAA,CAAA;;MCFY,6BAA6B,CAAA;AAGxC,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAU,CAAA,UAAA,GAAV,UAAU;AAFtB,QAAA,IAAA,CAAA,IAAI,GAAW,yBAAyB,CAAC,uBAAuB;;AAGjF;;MCJY,iBAAiB,CAAA;AAG5B,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAU,CAAA,UAAA,GAAV,UAAU;AAFtB,QAAA,IAAA,CAAA,IAAI,GAAW,yBAAyB,CAAC,WAAW;;AAGrE;;MCJY,iBAAiB,CAAA;AAG5B,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAU,CAAA,UAAA,GAAV,UAAU;AAFtB,QAAA,IAAA,CAAA,IAAI,GAAW,yBAAyB,CAAC,WAAW;;AAGrE;;MCJY,yBAAyB,CAAA;AAGpC,IAAA,WAAA,CAA4B,WAAqB,EAAA;QAArB,IAAW,CAAA,WAAA,GAAX,WAAW;AAFvB,QAAA,IAAA,CAAA,IAAI,GAAW,yBAAyB,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A,EAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,eAAA,EAAA,YAAA,EAAA,SAAA,EAAA,UAAA,EAAA,qBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gCAAgC,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,oBAAoB,EAAA,IAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAK1F,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAP1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,EAChC,OAAA,EAAA,CAAC,YAAY,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,oBAAoB,CAAC,EAGrF,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,iXAAA,EAAA;0EAG/B,KAAK,EAAA,CAAA;sBAApB;gBACuC,8BAA8B,EAAA,CAAA;sBAArE,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;;AElBxC;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, Injectable, inject, provideAppInitializer, signal, runInInjectionContext, Inject, Optional, Directive } from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, Injectable, inject, provideAppInitializer, signal, runInInjectionContext, Inject, Optional, Directive, computed } from '@angular/core';
3
3
  import { Subject, takeUntil, BehaviorSubject, map, distinctUntilChanged } from 'rxjs';
4
4
  import update from 'immutability-helper';
5
5
 
@@ -67,10 +67,10 @@ class Logger {
67
67
  payload
68
68
  });
69
69
  }
70
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
71
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Logger, providedIn: 'root' }); }
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
71
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: Logger, providedIn: 'root' }); }
72
72
  }
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Logger, decorators: [{
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: Logger, decorators: [{
74
74
  type: Injectable,
75
75
  args: [{
76
76
  providedIn: 'root'
@@ -106,10 +106,10 @@ class ConsoleAppender {
106
106
  stop() {
107
107
  this.stopEvent$.next(true);
108
108
  }
109
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ConsoleAppender, deps: [{ token: Logger }], target: i0.ɵɵFactoryTarget.Injectable }); }
110
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ConsoleAppender, providedIn: 'root' }); }
109
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ConsoleAppender, deps: [{ token: Logger }], target: i0.ɵɵFactoryTarget.Injectable }); }
110
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ConsoleAppender, providedIn: 'root' }); }
111
111
  }
112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ConsoleAppender, decorators: [{
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ConsoleAppender, decorators: [{
113
113
  type: Injectable,
114
114
  args: [{
115
115
  providedIn: 'root'
@@ -136,6 +136,7 @@ const provideConsoleAppender = (name) => {
136
136
 
137
137
  const featureStateSpecifications = [];
138
138
  const NgSsmFeatureState = (specification) => {
139
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
139
140
  return (target) => {
140
141
  featureStateSpecifications.push(specification);
141
142
  };
@@ -245,10 +246,10 @@ class Store {
245
246
  });
246
247
  }
247
248
  }
248
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Store, deps: [{ token: Logger }, { token: NGSSM_REDUCER, optional: true }, { token: NGSSM_EFFECT, optional: true }, { token: NGSSM_STATE_INITIALIZER, optional: true }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
249
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Store, providedIn: 'root' }); }
249
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: Store, deps: [{ token: Logger }, { token: NGSSM_REDUCER, optional: true }, { token: NGSSM_EFFECT, optional: true }, { token: NGSSM_STATE_INITIALIZER, optional: true }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
250
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: Store, providedIn: 'root' }); }
250
251
  }
251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Store, decorators: [{
252
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: Store, decorators: [{
252
253
  type: Injectable,
253
254
  args: [{
254
255
  providedIn: 'root'
@@ -316,10 +317,10 @@ class ProvideNgssmFeatureStateDirective {
316
317
  ngOnDestroy() {
317
318
  this.store.dispatchAction(new NgssmUnregisterFeatureStateAction(this.component.featureStateKey));
318
319
  }
319
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ProvideNgssmFeatureStateDirective, deps: [{ token: NGSSM_COMPONENT_WITH_FEATURE_STATE }, { token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
320
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: ProvideNgssmFeatureStateDirective, isStandalone: true, selector: "[provideNgssmFeatureState]", ngImport: i0 }); }
320
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ProvideNgssmFeatureStateDirective, deps: [{ token: NGSSM_COMPONENT_WITH_FEATURE_STATE }, { token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
321
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: ProvideNgssmFeatureStateDirective, isStandalone: true, selector: "[provideNgssmFeatureState]", ngImport: i0 }); }
321
322
  }
322
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ProvideNgssmFeatureStateDirective, decorators: [{
323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ProvideNgssmFeatureStateDirective, decorators: [{
323
324
  type: Directive,
324
325
  args: [{
325
326
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -352,10 +353,10 @@ class FeatureStateReducer {
352
353
  }
353
354
  return state;
354
355
  }
355
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: FeatureStateReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
356
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: FeatureStateReducer }); }
356
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FeatureStateReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
357
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FeatureStateReducer }); }
357
358
  }
358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: FeatureStateReducer, decorators: [{
359
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FeatureStateReducer, decorators: [{
359
360
  type: Injectable
360
361
  }] });
361
362
 
@@ -380,20 +381,23 @@ class NgSsmComponent {
380
381
  dispatchActionType(actionType) {
381
382
  this.store.dispatchActionType(actionType);
382
383
  }
383
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgSsmComponent, deps: [{ token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
384
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgSsmComponent, isStandalone: false, ngImport: i0 }); }
384
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: NgSsmComponent, deps: [{ token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
385
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: NgSsmComponent, isStandalone: true, ngImport: i0 }); }
385
386
  }
386
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgSsmComponent, decorators: [{
387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: NgSsmComponent, decorators: [{
387
388
  type: Directive,
388
- args: [{
389
- standalone: false
390
- }]
389
+ args: [{}]
391
390
  }], ctorParameters: () => [{ type: Store }] });
392
391
 
393
392
  const provideNgssmStore = () => {
394
393
  return makeEnvironmentProviders([provideReducers(FeatureStateReducer)]);
395
394
  };
396
395
 
396
+ const createSignal = (selector) => {
397
+ const store = inject(Store);
398
+ return computed(() => selector(store.state()));
399
+ };
400
+
397
401
  /*
398
402
  * Public API Surface of ngssm-store
399
403
  */
@@ -402,5 +406,5 @@ const provideNgssmStore = () => {
402
406
  * Generated bundle index. Do not edit.
403
407
  */
404
408
 
405
- export { ConsoleAppender, FeatureStateReducer, LogLevel, Logger, NGSSM_COMPONENT_WITH_FEATURE_STATE, NGSSM_CONSOLE_APPENDER_NAME, NGSSM_EFFECT, NGSSM_REDUCER, NGSSM_STATE_INITIALIZER, NgSsmComponent, NgSsmFeatureState, NgssmRegisterFeatureStateAction, NgssmStoreActionType, NgssmUnregisterFeatureStateAction, ProvideNgssmFeatureStateDirective, Store, provideConsoleAppender, provideEffect, provideEffectFunc, provideEffects, provideNgssmFeatureState, provideNgssmStore, provideReducer, provideReducers, startConsoleAppenderFactory };
409
+ export { ConsoleAppender, FeatureStateReducer, LogLevel, Logger, NGSSM_COMPONENT_WITH_FEATURE_STATE, NGSSM_CONSOLE_APPENDER_NAME, NGSSM_EFFECT, NGSSM_REDUCER, NGSSM_STATE_INITIALIZER, NgSsmComponent, NgSsmFeatureState, NgssmRegisterFeatureStateAction, NgssmStoreActionType, NgssmUnregisterFeatureStateAction, ProvideNgssmFeatureStateDirective, Store, createSignal, provideConsoleAppender, provideEffect, provideEffectFunc, provideEffects, provideNgssmFeatureState, provideNgssmStore, provideReducer, provideReducers, startConsoleAppenderFactory };
406
410
  //# sourceMappingURL=ngssm-store.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngssm-store.mjs","sources":["../../../projects/ngssm-store/src/lib/reducer.ts","../../../projects/ngssm-store/src/lib/effect.ts","../../../projects/ngssm-store/src/lib/state-initializer.ts","../../../projects/ngssm-store/src/lib/logging/log-level.ts","../../../projects/ngssm-store/src/lib/logging/logger.ts","../../../projects/ngssm-store/src/lib/logging/console-appender.ts","../../../projects/ngssm-store/src/lib/logging/provide-console-appender.ts","../../../projects/ngssm-store/src/lib/store.ts","../../../projects/ngssm-store/src/lib/feature-state/feature-state-specification.ts","../../../projects/ngssm-store/src/lib/actions/ngssm-store-action-type.ts","../../../projects/ngssm-store/src/lib/actions/ngssm-register-feature-state.action.ts","../../../projects/ngssm-store/src/lib/actions/ngssm-unregister-feature-state.action.ts","../../../projects/ngssm-store/src/lib/feature-state/provide-feature-state.ts","../../../projects/ngssm-store/src/lib/feature-state/provide-ngssm-feature-state.directive.ts","../../../projects/ngssm-store/src/lib/feature-state/feature-state.reducer.ts","../../../projects/ngssm-store/src/lib/ngssm-component.ts","../../../projects/ngssm-store/src/lib/provide-ngssm-store.ts","../../../projects/ngssm-store/src/public-api.ts","../../../projects/ngssm-store/src/ngssm-store.ts"],"sourcesContent":["import { EnvironmentProviders, InjectionToken, Type, makeEnvironmentProviders } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\n\nexport interface Reducer {\n processedActions: string[];\n updateState(state: State, action: Action): State;\n}\n\nexport const NGSSM_REDUCER = new InjectionToken<Reducer>('NGSSM_REDUCER');\n\nexport const provideReducer = (reducer: Type<any>): EnvironmentProviders => {\n return makeEnvironmentProviders([{ provide: NGSSM_REDUCER, useClass: reducer, multi: true }]);\n};\n\nexport const provideReducers = (...reducers: Type<any>[]): EnvironmentProviders => {\n return makeEnvironmentProviders(reducers.map((reducer) => ({ provide: NGSSM_REDUCER, useClass: reducer, multi: true })));\n};\n","import { EnvironmentProviders, InjectionToken, Type, makeEnvironmentProviders } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\nexport interface Effect {\n processedActions: string[];\n processAction(store: Store, state: State, action: Action): void;\n isFunc?: boolean;\n}\n\nexport const NGSSM_EFFECT = new InjectionToken<Effect>('NGSSM_EFFECT');\n\nexport const provideEffect = (effect: Type<any>): EnvironmentProviders => {\n return makeEnvironmentProviders([{ provide: NGSSM_EFFECT, useClass: effect, multi: true }]);\n};\n\nexport const provideEffects = (...effects: Type<any>[]): EnvironmentProviders => {\n return makeEnvironmentProviders(effects.map((effect) => ({ provide: NGSSM_EFFECT, useClass: effect, multi: true })));\n};\n\nexport interface EffectFunc {\n (state: State, action: Action): void;\n}\n\nexport const provideEffectFunc = (actionType: string, effectFunc: EffectFunc): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_EFFECT,\n useFactory: () => {\n const effect: Effect = {\n processedActions: [actionType],\n processAction: (_, state, action) => effectFunc(state, action),\n isFunc: true\n };\n return effect;\n },\n multi: true\n }\n ]);\n};\n","import { InjectionToken } from '@angular/core';\nimport { State } from './state';\n\nexport interface StateInitializer {\n initializeState(state: State): State;\n}\n\nexport const NGSSM_STATE_INITIALIZER = new InjectionToken<StateInitializer>('NGSSM_STATE_INITIALIZER');\n","export enum LogLevel {\n debug = 'Debug',\n information = 'Information',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { LogEvent } from './log-event';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Logger {\n private readonly _logEvents$ = new Subject<LogEvent>();\n\n public get logEvents$(): Observable<LogEvent> {\n return this._logEvents$.asObservable();\n }\n\n public debug(message: string, payload?: any): void {\n this.log(LogLevel.debug, message, payload);\n }\n\n public information(message: string, payload?: any): void {\n this.log(LogLevel.information, message, payload);\n }\n\n public error(message: string, payload?: any): void {\n this.log(LogLevel.error, message, payload);\n }\n\n public log(level: LogLevel, message: string, payload?: any): void {\n this._logEvents$.next({\n level,\n message,\n payload\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { Logger } from './logger';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleAppender {\n private readonly stopEvent$ = new Subject<boolean>();\n\n constructor(private logger: Logger) {}\n\n public start(contextName?: string): void {\n this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {\n let logFunction: any;\n switch (logEvent.level) {\n case LogLevel.error:\n logFunction = console.error;\n break;\n\n default:\n logFunction = console.log;\n break;\n }\n\n const now = new Date().toLocaleString();\n const prefix = contextName ? `[${contextName}] ` : '';\n\n if (logEvent.payload) {\n logFunction(`${prefix}[${now}] [${logEvent.level}] ${logEvent.message}`, logEvent.payload);\n } else {\n logFunction(`${prefix}[${now}] [${logEvent.level}] ${logEvent.message}`);\n }\n });\n }\n\n public stop(): void {\n this.stopEvent$.next(true);\n }\n}\n","import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\nimport { ConsoleAppender } from './console-appender';\n\nexport const NGSSM_CONSOLE_APPENDER_NAME = new InjectionToken<string>('NGSSM_CONSOLE_APPENDER_NAME');\n\nexport const startConsoleAppenderFactory = (): (() => void) => {\n return () => {\n const name = inject(NGSSM_CONSOLE_APPENDER_NAME);\n const consoleAppender = inject(ConsoleAppender);\n consoleAppender.start(name);\n };\n};\n\nexport const provideConsoleAppender = (name: string): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_CONSOLE_APPENDER_NAME,\n useValue: name\n },\n provideAppInitializer(startConsoleAppenderFactory())\n ]);\n};\n","import { EnvironmentInjector, Inject, Injectable, Optional, Signal, runInInjectionContext, signal } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport update from 'immutability-helper';\n\nimport { FeatureStateSpecification } from './feature-state';\nimport { State } from './state';\nimport { Action } from './action';\nimport { NGSSM_REDUCER, Reducer } from './reducer';\nimport { Effect, NGSSM_EFFECT } from './effect';\nimport { NGSSM_STATE_INITIALIZER, StateInitializer } from './state-initializer';\nimport { Logger } from './logging';\n\nconst featureStateSpecifications: FeatureStateSpecification[] = [];\nexport const NgSsmFeatureState = (specification: FeatureStateSpecification) => {\n return (target: object) => {\n featureStateSpecifications.push(specification);\n };\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Store {\n private readonly _state$ = new BehaviorSubject<State>({});\n private readonly actionQueue: Action[] = [];\n private readonly reducersPerActionType = new Map<string, Reducer[]>();\n private readonly effectsPerActionType = new Map<string, Effect[]>();\n private readonly _stateSignal = signal<State>({});\n\n constructor(\n private logger: Logger,\n @Inject(NGSSM_REDUCER) @Optional() reducers: Reducer[],\n @Inject(NGSSM_EFFECT) @Optional() effects: Effect[],\n @Inject(NGSSM_STATE_INITIALIZER) @Optional() initializers: StateInitializer[],\n private injector: EnvironmentInjector\n ) {\n this._state$.subscribe((value) => this._stateSignal.set(value));\n this.logger.information('[Store] ---> state initialization...');\n let state = this._state$.getValue();\n state = featureStateSpecifications.reduce((p, c) => update(p, { [c.featureStateKey]: { $set: c.initialState } }), state);\n\n (initializers ?? []).forEach((initializer) => {\n this.logger.information('[Store] ------> calling initializer', initializer);\n state = initializer.initializeState(state);\n });\n\n this._state$.next(state);\n\n this.logger.information(`[Store] ---> initialization of ${(reducers ?? []).length} reducers...`);\n (reducers ?? []).forEach((reducer) => {\n this.logger.information('[Store] ------> initialization of ', reducer);\n reducer.processedActions.forEach((processedAction) => {\n const storeReducers: Reducer[] = this.reducersPerActionType.get(processedAction) ?? [];\n if (storeReducers.length === 0) {\n this.reducersPerActionType.set(processedAction, storeReducers);\n }\n\n storeReducers.push(reducer);\n });\n });\n\n this.logger.information(`[Store] ---> initialization of ${(effects ?? []).length} effects...`);\n (effects ?? []).forEach((effect) => {\n this.logger.information('[Store] ------> initialization of ', effect);\n effect.processedActions.forEach((processedAction) => {\n const storedEffects: Effect[] = this.effectsPerActionType.get(processedAction) ?? [];\n if (storedEffects.length === 0) {\n this.effectsPerActionType.set(processedAction, storedEffects);\n }\n\n storedEffects.push(effect);\n });\n });\n }\n\n public get state$(): Observable<State> {\n return this._state$.asObservable();\n }\n\n public get state(): Signal<State> {\n return this._stateSignal.asReadonly();\n }\n\n public dispatchAction(action: Action): void {\n this.actionQueue.push(action);\n this.logger.debug(`Action of type '${action.type}' added to the queue => ${this.actionQueue.length} pending actions`, action);\n setTimeout(() => this.processNextAction());\n }\n\n public dispatchActionType(type: string): void {\n this.dispatchAction({ type });\n }\n\n private processNextAction(): void {\n const nextAction = this.actionQueue.shift();\n if (!nextAction) {\n this.logger.debug('[processNextAction] No action to process');\n return;\n }\n\n this.logger.information(`[processNextAction] Start processing action '${nextAction.type}...`, nextAction);\n\n try {\n const reducers = this.reducersPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${reducers.length} reducers found to process the action ${nextAction.type}`, reducers);\n const currentState = this._state$.getValue();\n const updatedState = reducers.reduce((p, c) => c.updateState(p, nextAction), currentState);\n\n if (updatedState !== currentState) {\n this._state$.next(updatedState);\n }\n\n const effects = this.effectsPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${effects.length} effects found to process the action ${nextAction.type}`, effects);\n effects.forEach((effect) => {\n if (effect.isFunc === true) {\n runInInjectionContext(this.injector, () => this.runEffect(effect, updatedState, nextAction));\n } else {\n this.runEffect(effect, updatedState, nextAction);\n }\n });\n } catch (error) {\n this.logger.error(`Error when processing action ${nextAction.type}`, {\n error,\n action: nextAction\n });\n } finally {\n this.logger.information(`[processNextAction] action '${nextAction.type} processed.`, nextAction);\n\n // Should not be useful.But, just in case.\n setTimeout(() => this.processNextAction());\n }\n }\n\n private runEffect(effect: Effect, updatedState: State, nextAction: Action) {\n try {\n effect.processAction(this, updatedState, nextAction);\n } catch (error) {\n this.logger.error(`Unable to process action ${nextAction.type} by effect ${effect}`, {\n error,\n action: nextAction,\n processor: effect\n });\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface FeatureStateSpecification {\n readonly featureStateKey: string;\n readonly initialState: object;\n}\n\nexport const NGSSM_COMPONENT_WITH_FEATURE_STATE = new InjectionToken<FeatureStateSpecification>('NGSSM_COMPONENT_WITH_FEATURE_STATE');\n","export enum NgssmStoreActionType {\n registerFeatureState = '[NgssmStoreActionType] registerFeatureState',\n unregisterFeatureState = '[NgssmStoreActionType] unregisterFeatureState'\n}\n","import { Action } from '../action';\nimport { NgssmStoreActionType } from './ngssm-store-action-type';\n\nexport class NgssmRegisterFeatureStateAction implements Action {\n public readonly type: string = NgssmStoreActionType.registerFeatureState;\n\n constructor(\n public readonly featureStateKey: string,\n public readonly initialValue: object\n ) {}\n}\n","import { Action } from '../action';\nimport { NgssmStoreActionType } from './ngssm-store-action-type';\n\nexport class NgssmUnregisterFeatureStateAction implements Action {\n public readonly type: string = NgssmStoreActionType.unregisterFeatureState;\n\n constructor(public readonly featureStateKey: string) {}\n}\n","import { EnvironmentProviders, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\nimport { Store } from '../store';\nimport { NgssmRegisterFeatureStateAction } from '../actions';\n\nconst registerFeatureState = (featureStateKey: string, initialValue: object) => {\n return () => {\n inject(Store).dispatchAction(new NgssmRegisterFeatureStateAction(featureStateKey, initialValue));\n };\n};\n\nexport const provideNgssmFeatureState = (featureStateKey: string, initialValue: object): EnvironmentProviders => {\n return makeEnvironmentProviders([provideAppInitializer(registerFeatureState(featureStateKey, initialValue))]);\n};\n","import { Directive, Inject, InjectionToken, OnDestroy } from '@angular/core';\n\nimport { Store } from '../store';\nimport { NgssmRegisterFeatureStateAction, NgssmUnregisterFeatureStateAction } from '../actions';\nimport { FeatureStateSpecification, NGSSM_COMPONENT_WITH_FEATURE_STATE } from './feature-state-specification';\n\n// export interface ComponentWithFeatureState {\n// featureStateKey: string;\n// initialValue: object;\n// }\n\n// export const NGSSM_COMPONENT_WITH_FEATURE_STATE = new InjectionToken<ComponentWithFeatureState>('NGSSM_COMPONENT_WITH_FEATURE_STATE');\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[provideNgssmFeatureState]',\n standalone: true\n})\nexport class ProvideNgssmFeatureStateDirective implements OnDestroy {\n constructor(\n @Inject(NGSSM_COMPONENT_WITH_FEATURE_STATE) private component: FeatureStateSpecification,\n private store: Store\n ) {\n this.store.dispatchAction(new NgssmRegisterFeatureStateAction(this.component.featureStateKey, this.component.initialState));\n }\n\n public ngOnDestroy(): void {\n this.store.dispatchAction(new NgssmUnregisterFeatureStateAction(this.component.featureStateKey));\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport update from 'immutability-helper';\n\nimport { Reducer } from '../reducer';\nimport { NgssmRegisterFeatureStateAction, NgssmStoreActionType, NgssmUnregisterFeatureStateAction } from '../actions';\nimport { State } from '../state';\nimport { Action } from '../action';\n\n@Injectable()\nexport class FeatureStateReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmStoreActionType.registerFeatureState, NgssmStoreActionType.unregisterFeatureState];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmStoreActionType.registerFeatureState: {\n const registerFeatureStateAction = action as NgssmRegisterFeatureStateAction;\n return update(state, {\n [registerFeatureStateAction.featureStateKey]: { $set: registerFeatureStateAction.initialValue }\n });\n }\n\n case NgssmStoreActionType.unregisterFeatureState: {\n const unregisterFeatureStateAction = action as NgssmUnregisterFeatureStateAction;\n return update(state, {\n $unset: [unregisterFeatureStateAction.featureStateKey]\n });\n }\n }\n\n return state;\n }\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { map, Observable, Subject, distinctUntilChanged, takeUntil } from 'rxjs';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\n@Directive({\n standalone: false\n})\nexport class NgSsmComponent implements OnDestroy {\n private readonly _unsubscribeAll$ = new Subject<void>();\n\n constructor(protected store: Store) {}\n\n protected get unsubscribeAll$(): Observable<void> {\n return this._unsubscribeAll$.asObservable();\n }\n\n public ngOnDestroy(): void {\n this._unsubscribeAll$.next();\n this._unsubscribeAll$.complete();\n }\n\n public watch<T>(selector: (state: State) => T): Observable<T> {\n return this.store.state$.pipe(\n map((state) => selector(state)),\n distinctUntilChanged(),\n takeUntil(this.unsubscribeAll$)\n );\n }\n\n public dispatchAction(action: Action): void {\n this.store.dispatchAction(action);\n }\n\n public dispatchActionType(actionType: string): void {\n this.store.dispatchActionType(actionType);\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { provideReducers } from './reducer';\nimport { FeatureStateReducer } from './feature-state';\n\nexport const provideNgssmStore = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(FeatureStateReducer)]);\n};\n","/*\n * Public API Surface of ngssm-store\n */\n\nexport * from './lib/store';\nexport * from './lib/state';\nexport * from './lib/action';\nexport * from './lib/reducer';\nexport * from './lib/effect';\nexport * from './lib/feature-state';\nexport * from './lib/ngssm-component';\nexport * from './lib/state-initializer';\nexport * from './lib/logging';\nexport * from './lib/actions';\nexport * from './lib/provide-ngssm-store';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.Logger","i1.Store"],"mappings":";;;;;MAUa,aAAa,GAAG,IAAI,cAAc,CAAU,eAAe;AAE3D,MAAA,cAAc,GAAG,CAAC,OAAkB,KAA0B;AACzE,IAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/F;MAEa,eAAe,GAAG,CAAC,GAAG,QAAqB,KAA0B;AAChF,IAAA,OAAO,wBAAwB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1H;;MCNa,YAAY,GAAG,IAAI,cAAc,CAAS,cAAc;AAExD,MAAA,aAAa,GAAG,CAAC,MAAiB,KAA0B;AACvE,IA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2B;IAC1D,OAAO,wBAAwB,CAAC,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC,CAAC;AACzE;;ACPA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngssm-store.mjs","sources":["../../../projects/ngssm-store/src/lib/reducer.ts","../../../projects/ngssm-store/src/lib/effect.ts","../../../projects/ngssm-store/src/lib/state-initializer.ts","../../../projects/ngssm-store/src/lib/logging/log-level.ts","../../../projects/ngssm-store/src/lib/logging/logger.ts","../../../projects/ngssm-store/src/lib/logging/console-appender.ts","../../../projects/ngssm-store/src/lib/logging/provide-console-appender.ts","../../../projects/ngssm-store/src/lib/store.ts","../../../projects/ngssm-store/src/lib/feature-state/feature-state-specification.ts","../../../projects/ngssm-store/src/lib/actions/ngssm-store-action-type.ts","../../../projects/ngssm-store/src/lib/actions/ngssm-register-feature-state.action.ts","../../../projects/ngssm-store/src/lib/actions/ngssm-unregister-feature-state.action.ts","../../../projects/ngssm-store/src/lib/feature-state/provide-feature-state.ts","../../../projects/ngssm-store/src/lib/feature-state/provide-ngssm-feature-state.directive.ts","../../../projects/ngssm-store/src/lib/feature-state/feature-state.reducer.ts","../../../projects/ngssm-store/src/lib/ngssm-component.ts","../../../projects/ngssm-store/src/lib/provide-ngssm-store.ts","../../../projects/ngssm-store/src/lib/signal-helpers.ts","../../../projects/ngssm-store/src/public-api.ts","../../../projects/ngssm-store/src/ngssm-store.ts"],"sourcesContent":["import { EnvironmentProviders, InjectionToken, Type, makeEnvironmentProviders } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\n\nexport interface Reducer {\n processedActions: string[];\n updateState(state: State, action: Action): State;\n}\n\nexport const NGSSM_REDUCER = new InjectionToken<Reducer>('NGSSM_REDUCER');\n\nexport const provideReducer = (reducer: Type<unknown>): EnvironmentProviders => {\n return makeEnvironmentProviders([{ provide: NGSSM_REDUCER, useClass: reducer, multi: true }]);\n};\n\nexport const provideReducers = (...reducers: Type<unknown>[]): EnvironmentProviders => {\n return makeEnvironmentProviders(reducers.map((reducer) => ({ provide: NGSSM_REDUCER, useClass: reducer, multi: true })));\n};\n","import { EnvironmentProviders, InjectionToken, Type, makeEnvironmentProviders } from '@angular/core';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\nexport interface Effect {\n processedActions: string[];\n processAction(store: Store, state: State, action: Action): void;\n isFunc?: boolean;\n}\n\nexport const NGSSM_EFFECT = new InjectionToken<Effect>('NGSSM_EFFECT');\n\nexport const provideEffect = (effect: Type<unknown>): EnvironmentProviders => {\n return makeEnvironmentProviders([{ provide: NGSSM_EFFECT, useClass: effect, multi: true }]);\n};\n\nexport const provideEffects = (...effects: Type<unknown>[]): EnvironmentProviders => {\n return makeEnvironmentProviders(effects.map((effect) => ({ provide: NGSSM_EFFECT, useClass: effect, multi: true })));\n};\n\nexport type EffectFunc = (state: State, action: Action) => void;\n\nexport const provideEffectFunc = (actionType: string, effectFunc: EffectFunc): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_EFFECT,\n useFactory: () => {\n const effect: Effect = {\n processedActions: [actionType],\n processAction: (_, state, action) => effectFunc(state, action),\n isFunc: true\n };\n return effect;\n },\n multi: true\n }\n ]);\n};\n","import { InjectionToken } from '@angular/core';\nimport { State } from './state';\n\nexport interface StateInitializer {\n initializeState(state: State): State;\n}\n\nexport const NGSSM_STATE_INITIALIZER = new InjectionToken<StateInitializer>('NGSSM_STATE_INITIALIZER');\n","export enum LogLevel {\n debug = 'Debug',\n information = 'Information',\n error = 'Error'\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { LogEvent } from './log-event';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Logger {\n private readonly _logEvents$ = new Subject<LogEvent>();\n\n public get logEvents$(): Observable<LogEvent> {\n return this._logEvents$.asObservable();\n }\n\n public debug(message: string, payload?: unknown): void {\n this.log(LogLevel.debug, message, payload);\n }\n\n public information(message: string, payload?: unknown): void {\n this.log(LogLevel.information, message, payload);\n }\n\n public error(message: string, payload?: unknown): void {\n this.log(LogLevel.error, message, payload);\n }\n\n public log(level: LogLevel, message: string, payload?: unknown): void {\n this._logEvents$.next({\n level,\n message,\n payload\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\nimport { Logger } from './logger';\nimport { LogLevel } from './log-level';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleAppender {\n private readonly stopEvent$ = new Subject<boolean>();\n\n constructor(private logger: Logger) {}\n\n public start(contextName?: string): void {\n this.logger.logEvents$.pipe(takeUntil(this.stopEvent$)).subscribe((logEvent) => {\n let logFunction: (...data:unknown[])=> void;\n switch (logEvent.level) {\n case LogLevel.error:\n logFunction = console.error;\n break;\n\n default:\n logFunction = console.log;\n break;\n }\n\n const now = new Date().toLocaleString();\n const prefix = contextName ? `[${contextName}] ` : '';\n\n if (logEvent.payload) {\n logFunction(`${prefix}[${now}] [${logEvent.level}] ${logEvent.message}`, logEvent.payload);\n } else {\n logFunction(`${prefix}[${now}] [${logEvent.level}] ${logEvent.message}`);\n }\n });\n }\n\n public stop(): void {\n this.stopEvent$.next(true);\n }\n}\n","import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\nimport { ConsoleAppender } from './console-appender';\n\nexport const NGSSM_CONSOLE_APPENDER_NAME = new InjectionToken<string>('NGSSM_CONSOLE_APPENDER_NAME');\n\nexport const startConsoleAppenderFactory = (): (() => void) => {\n return () => {\n const name = inject(NGSSM_CONSOLE_APPENDER_NAME);\n const consoleAppender = inject(ConsoleAppender);\n consoleAppender.start(name);\n };\n};\n\nexport const provideConsoleAppender = (name: string): EnvironmentProviders => {\n return makeEnvironmentProviders([\n {\n provide: NGSSM_CONSOLE_APPENDER_NAME,\n useValue: name\n },\n provideAppInitializer(startConsoleAppenderFactory())\n ]);\n};\n","import { EnvironmentInjector, Inject, Injectable, Optional, Signal, runInInjectionContext, signal } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport update from 'immutability-helper';\n\nimport { FeatureStateSpecification } from './feature-state';\nimport { State } from './state';\nimport { Action } from './action';\nimport { NGSSM_REDUCER, Reducer } from './reducer';\nimport { Effect, NGSSM_EFFECT } from './effect';\nimport { NGSSM_STATE_INITIALIZER, StateInitializer } from './state-initializer';\nimport { Logger } from './logging';\n\nconst featureStateSpecifications: FeatureStateSpecification[] = [];\nexport const NgSsmFeatureState = (specification: FeatureStateSpecification) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n return (target: object) => {\n featureStateSpecifications.push(specification);\n };\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Store {\n private readonly _state$ = new BehaviorSubject<State>({});\n private readonly actionQueue: Action[] = [];\n private readonly reducersPerActionType = new Map<string, Reducer[]>();\n private readonly effectsPerActionType = new Map<string, Effect[]>();\n private readonly _stateSignal = signal<State>({});\n\n constructor(\n private logger: Logger,\n @Inject(NGSSM_REDUCER) @Optional() reducers: Reducer[],\n @Inject(NGSSM_EFFECT) @Optional() effects: Effect[],\n @Inject(NGSSM_STATE_INITIALIZER) @Optional() initializers: StateInitializer[],\n private injector: EnvironmentInjector\n ) {\n this._state$.subscribe((value) => this._stateSignal.set(value));\n this.logger.information('[Store] ---> state initialization...');\n let state = this._state$.getValue();\n state = featureStateSpecifications.reduce((p, c) => update(p, { [c.featureStateKey]: { $set: c.initialState } }), state);\n\n (initializers ?? []).forEach((initializer) => {\n this.logger.information('[Store] ------> calling initializer', initializer);\n state = initializer.initializeState(state);\n });\n\n this._state$.next(state);\n\n this.logger.information(`[Store] ---> initialization of ${(reducers ?? []).length} reducers...`);\n (reducers ?? []).forEach((reducer) => {\n this.logger.information('[Store] ------> initialization of ', reducer);\n reducer.processedActions.forEach((processedAction) => {\n const storeReducers: Reducer[] = this.reducersPerActionType.get(processedAction) ?? [];\n if (storeReducers.length === 0) {\n this.reducersPerActionType.set(processedAction, storeReducers);\n }\n\n storeReducers.push(reducer);\n });\n });\n\n this.logger.information(`[Store] ---> initialization of ${(effects ?? []).length} effects...`);\n (effects ?? []).forEach((effect) => {\n this.logger.information('[Store] ------> initialization of ', effect);\n effect.processedActions.forEach((processedAction) => {\n const storedEffects: Effect[] = this.effectsPerActionType.get(processedAction) ?? [];\n if (storedEffects.length === 0) {\n this.effectsPerActionType.set(processedAction, storedEffects);\n }\n\n storedEffects.push(effect);\n });\n });\n }\n\n public get state$(): Observable<State> {\n return this._state$.asObservable();\n }\n\n public get state(): Signal<State> {\n return this._stateSignal.asReadonly();\n }\n\n public dispatchAction(action: Action): void {\n this.actionQueue.push(action);\n this.logger.debug(`Action of type '${action.type}' added to the queue => ${this.actionQueue.length} pending actions`, action);\n setTimeout(() => this.processNextAction());\n }\n\n public dispatchActionType(type: string): void {\n this.dispatchAction({ type });\n }\n\n private processNextAction(): void {\n const nextAction = this.actionQueue.shift();\n if (!nextAction) {\n this.logger.debug('[processNextAction] No action to process');\n return;\n }\n\n this.logger.information(`[processNextAction] Start processing action '${nextAction.type}...`, nextAction);\n\n try {\n const reducers = this.reducersPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${reducers.length} reducers found to process the action ${nextAction.type}`, reducers);\n const currentState = this._state$.getValue();\n const updatedState = reducers.reduce((p, c) => c.updateState(p, nextAction), currentState);\n\n if (updatedState !== currentState) {\n this._state$.next(updatedState);\n }\n\n const effects = this.effectsPerActionType.get(nextAction.type) ?? [];\n this.logger.debug(`[Store] ${effects.length} effects found to process the action ${nextAction.type}`, effects);\n effects.forEach((effect) => {\n if (effect.isFunc === true) {\n runInInjectionContext(this.injector, () => this.runEffect(effect, updatedState, nextAction));\n } else {\n this.runEffect(effect, updatedState, nextAction);\n }\n });\n } catch (error) {\n this.logger.error(`Error when processing action ${nextAction.type}`, {\n error,\n action: nextAction\n });\n } finally {\n this.logger.information(`[processNextAction] action '${nextAction.type} processed.`, nextAction);\n\n // Should not be useful.But, just in case.\n setTimeout(() => this.processNextAction());\n }\n }\n\n private runEffect(effect: Effect, updatedState: State, nextAction: Action) {\n try {\n effect.processAction(this, updatedState, nextAction);\n } catch (error) {\n this.logger.error(`Unable to process action ${nextAction.type} by effect ${effect}`, {\n error,\n action: nextAction,\n processor: effect\n });\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface FeatureStateSpecification {\n readonly featureStateKey: string;\n readonly initialState: object;\n}\n\nexport const NGSSM_COMPONENT_WITH_FEATURE_STATE = new InjectionToken<FeatureStateSpecification>('NGSSM_COMPONENT_WITH_FEATURE_STATE');\n","export enum NgssmStoreActionType {\n registerFeatureState = '[NgssmStoreActionType] registerFeatureState',\n unregisterFeatureState = '[NgssmStoreActionType] unregisterFeatureState'\n}\n","import { Action } from '../action';\nimport { NgssmStoreActionType } from './ngssm-store-action-type';\n\nexport class NgssmRegisterFeatureStateAction implements Action {\n public readonly type: string = NgssmStoreActionType.registerFeatureState;\n\n constructor(\n public readonly featureStateKey: string,\n public readonly initialValue: object\n ) {}\n}\n","import { Action } from '../action';\nimport { NgssmStoreActionType } from './ngssm-store-action-type';\n\nexport class NgssmUnregisterFeatureStateAction implements Action {\n public readonly type: string = NgssmStoreActionType.unregisterFeatureState;\n\n constructor(public readonly featureStateKey: string) {}\n}\n","import { EnvironmentProviders, makeEnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\nimport { Store } from '../store';\nimport { NgssmRegisterFeatureStateAction } from '../actions';\n\nconst registerFeatureState = (featureStateKey: string, initialValue: object) => {\n return () => {\n inject(Store).dispatchAction(new NgssmRegisterFeatureStateAction(featureStateKey, initialValue));\n };\n};\n\nexport const provideNgssmFeatureState = (featureStateKey: string, initialValue: object): EnvironmentProviders => {\n return makeEnvironmentProviders([provideAppInitializer(registerFeatureState(featureStateKey, initialValue))]);\n};\n","import { Directive, Inject, OnDestroy } from '@angular/core';\n\nimport { Store } from '../store';\nimport { NgssmRegisterFeatureStateAction, NgssmUnregisterFeatureStateAction } from '../actions';\nimport { FeatureStateSpecification, NGSSM_COMPONENT_WITH_FEATURE_STATE } from './feature-state-specification';\n\n// export interface ComponentWithFeatureState {\n// featureStateKey: string;\n// initialValue: object;\n// }\n\n// export const NGSSM_COMPONENT_WITH_FEATURE_STATE = new InjectionToken<ComponentWithFeatureState>('NGSSM_COMPONENT_WITH_FEATURE_STATE');\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[provideNgssmFeatureState]',\n standalone: true\n})\nexport class ProvideNgssmFeatureStateDirective implements OnDestroy {\n constructor(\n @Inject(NGSSM_COMPONENT_WITH_FEATURE_STATE) private component: FeatureStateSpecification,\n private store: Store\n ) {\n this.store.dispatchAction(new NgssmRegisterFeatureStateAction(this.component.featureStateKey, this.component.initialState));\n }\n\n public ngOnDestroy(): void {\n this.store.dispatchAction(new NgssmUnregisterFeatureStateAction(this.component.featureStateKey));\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport update from 'immutability-helper';\n\nimport { Reducer } from '../reducer';\nimport { NgssmRegisterFeatureStateAction, NgssmStoreActionType, NgssmUnregisterFeatureStateAction } from '../actions';\nimport { State } from '../state';\nimport { Action } from '../action';\n\n@Injectable()\nexport class FeatureStateReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmStoreActionType.registerFeatureState, NgssmStoreActionType.unregisterFeatureState];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmStoreActionType.registerFeatureState: {\n const registerFeatureStateAction = action as NgssmRegisterFeatureStateAction;\n return update(state, {\n [registerFeatureStateAction.featureStateKey]: { $set: registerFeatureStateAction.initialValue }\n });\n }\n\n case NgssmStoreActionType.unregisterFeatureState: {\n const unregisterFeatureStateAction = action as NgssmUnregisterFeatureStateAction;\n return update(state, {\n $unset: [unregisterFeatureStateAction.featureStateKey]\n });\n }\n }\n\n return state;\n }\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { map, Observable, Subject, distinctUntilChanged, takeUntil } from 'rxjs';\n\nimport { Action } from './action';\nimport { State } from './state';\nimport { Store } from './store';\n\n@Directive({\n})\nexport class NgSsmComponent implements OnDestroy {\n private readonly _unsubscribeAll$ = new Subject<void>();\n\n constructor(protected store: Store) {}\n\n protected get unsubscribeAll$(): Observable<void> {\n return this._unsubscribeAll$.asObservable();\n }\n\n public ngOnDestroy(): void {\n this._unsubscribeAll$.next();\n this._unsubscribeAll$.complete();\n }\n\n public watch<T>(selector: (state: State) => T): Observable<T> {\n return this.store.state$.pipe(\n map((state) => selector(state)),\n distinctUntilChanged(),\n takeUntil(this.unsubscribeAll$)\n );\n }\n\n public dispatchAction(action: Action): void {\n this.store.dispatchAction(action);\n }\n\n public dispatchActionType(actionType: string): void {\n this.store.dispatchActionType(actionType);\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { provideReducers } from './reducer';\nimport { FeatureStateReducer } from './feature-state';\n\nexport const provideNgssmStore = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(FeatureStateReducer)]);\n};\n","import { computed, inject, Signal } from '@angular/core';\nimport { State } from './state';\nimport { Store } from './store';\n\nexport const createSignal = <T = unknown>(selector: (state: State) => T): Signal<T> => {\n const store = inject(Store);\n return computed(() => selector(store.state()));\n};\n","/*\n * Public API Surface of ngssm-store\n */\n\nexport * from './lib/store';\nexport * from './lib/state';\nexport * from './lib/action';\nexport * from './lib/reducer';\nexport * from './lib/effect';\nexport * from './lib/feature-state';\nexport * from './lib/ngssm-component';\nexport * from './lib/state-initializer';\nexport * from './lib/logging';\nexport * from './lib/actions';\nexport * from './lib/provide-ngssm-store';\nexport * from './lib/signal-helpers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.Logger","i1.Store"],"mappings":";;;;;MAUa,aAAa,GAAG,IAAI,cAAc,CAAU,eAAe;AAE3D,MAAA,cAAc,GAAG,CAAC,OAAsB,KAA0B;AAC7E,IAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE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AAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,UAAU,CAAC;;8GA3BhC,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,KAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAF1B,SAAS;mBAAC,EACV;;;ACHM,MAAM,iBAAiB,GAAG,MAA2B;IAC1D,OAAO,wBAAwB,CAAC,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC,CAAC;AACzE;;ACHa,MAAA,YAAY,GAAG,CAAc,QAA6B,KAAe;AACpF,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,IAAA,OAAO,QAAQ,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;AAChD;;ACPA;;AAEG;;ACFH;;AAEG;;;;"}
package/lib/effect.d.ts CHANGED
@@ -8,9 +8,7 @@ export interface Effect {
8
8
  isFunc?: boolean;
9
9
  }
10
10
  export declare const NGSSM_EFFECT: InjectionToken<Effect>;
11
- export declare const provideEffect: (effect: Type<any>) => EnvironmentProviders;
12
- export declare const provideEffects: (...effects: Type<any>[]) => EnvironmentProviders;
13
- export interface EffectFunc {
14
- (state: State, action: Action): void;
15
- }
11
+ export declare const provideEffect: (effect: Type<unknown>) => EnvironmentProviders;
12
+ export declare const provideEffects: (...effects: Type<unknown>[]) => EnvironmentProviders;
13
+ export type EffectFunc = (state: State, action: Action) => void;
16
14
  export declare const provideEffectFunc: (actionType: string, effectFunc: EffectFunc) => EnvironmentProviders;
@@ -2,5 +2,5 @@ import { LogLevel } from './log-level';
2
2
  export interface LogEvent {
3
3
  level: LogLevel;
4
4
  message: string;
5
- payload?: any;
5
+ payload?: unknown;
6
6
  }
@@ -5,10 +5,10 @@ import * as i0 from "@angular/core";
5
5
  export declare class Logger {
6
6
  private readonly _logEvents$;
7
7
  get logEvents$(): Observable<LogEvent>;
8
- debug(message: string, payload?: any): void;
9
- information(message: string, payload?: any): void;
10
- error(message: string, payload?: any): void;
11
- log(level: LogLevel, message: string, payload?: any): void;
8
+ debug(message: string, payload?: unknown): void;
9
+ information(message: string, payload?: unknown): void;
10
+ error(message: string, payload?: unknown): void;
11
+ log(level: LogLevel, message: string, payload?: unknown): void;
12
12
  static ɵfac: i0.ɵɵFactoryDeclaration<Logger, never>;
13
13
  static ɵprov: i0.ɵɵInjectableDeclaration<Logger>;
14
14
  }
@@ -14,5 +14,5 @@ export declare class NgSsmComponent implements OnDestroy {
14
14
  dispatchAction(action: Action): void;
15
15
  dispatchActionType(actionType: string): void;
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<NgSsmComponent, never>;
17
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSsmComponent, never, never, {}, {}, never, never, false, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgSsmComponent, never, never, {}, {}, never, never, true, never>;
18
18
  }
package/lib/reducer.d.ts CHANGED
@@ -6,5 +6,5 @@ export interface Reducer {
6
6
  updateState(state: State, action: Action): State;
7
7
  }
8
8
  export declare const NGSSM_REDUCER: InjectionToken<Reducer>;
9
- export declare const provideReducer: (reducer: Type<any>) => EnvironmentProviders;
10
- export declare const provideReducers: (...reducers: Type<any>[]) => EnvironmentProviders;
9
+ export declare const provideReducer: (reducer: Type<unknown>) => EnvironmentProviders;
10
+ export declare const provideReducers: (...reducers: Type<unknown>[]) => EnvironmentProviders;
@@ -0,0 +1,3 @@
1
+ import { Signal } from '@angular/core';
2
+ import { State } from './state';
3
+ export declare const createSignal: <T = unknown>(selector: (state: State) => T) => Signal<T>;
package/lib/state.d.ts CHANGED
@@ -1,3 +1 @@
1
- export interface State {
2
- [key: string]: object;
3
- }
1
+ export type State = Record<string, object>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngssm-store",
3
- "version": "19.0.0",
3
+ "version": "19.1.0",
4
4
  "description": "NgSsm - Simple state management implementation.",
5
5
  "author": "Lion Marc",
6
6
  "license": "MIT",
package/public-api.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from './lib/state-initializer';
9
9
  export * from './lib/logging';
10
10
  export * from './lib/actions';
11
11
  export * from './lib/provide-ngssm-store';
12
+ export * from './lib/signal-helpers';
@@ -3,9 +3,7 @@ import { State } from 'ngssm-store';
3
3
  export declare const selectNgssmVisibilityState: (state: State) => NgssmVisibilityState;
4
4
  export declare const updateNgssmVisibilityState: (state: State, command: Spec<NgssmVisibilityState, never>) => State;
5
5
  export interface NgssmVisibilityState {
6
- elements: {
7
- [key: string]: boolean;
8
- };
6
+ elements: Record<string, boolean>;
9
7
  elementsGroups: string[][];
10
8
  }
11
9
  export declare class NgssmVisibilityStateSpecification {