1+ <a name =" 19.2.1 " ></a >
2+
3+ ## [ 19.2.1] ( https://github.com/ngrx/platform/compare/19.2.0...19.2.1 ) (2025-05-29)
4+
5+ ### Bug Fixes
6+
7+ - ** signals:** add current state as second argument of case reducer ([ #4800 ] ( https://github.com/ngrx/platform/issues/4800 ) ) ([ 95dbbfa] ( https://github.com/ngrx/platform/commit/95dbbfa ) )
8+ - ** signals:** expose WritableStateSource to withFeature callback ([ #4792 ] ( https://github.com/ngrx/platform/issues/4792 ) ) ([ afb6528] ( https://github.com/ngrx/platform/commit/afb6528 ) ), closes [ #4766 ] ( https://github.com/ngrx/platform/issues/4766 )
9+
110<a name =" 19.2.0 " ></a >
211
312# [ 19.2.0] ( https://github.com/ngrx/platform/compare/19.1.0...19.2.0 ) (2025-05-12)
@@ -65,10 +74,18 @@ BEFORE:
6574
6675``` ts
6776import { computed , Signal } from ' @angular/core' ;
68- import { signalStoreFeature , SignalStoreFeature , type , withComputed } from ' @ngrx/signals' ;
77+ import {
78+ signalStoreFeature ,
79+ SignalStoreFeature ,
80+ type ,
81+ withComputed ,
82+ } from ' @ngrx/signals' ;
6983import { EntityComputed } from ' @ngrx/signals/entities' ;
7084
71- export function withTotalEntities<Entity >(): SignalStoreFeature <{ state: {}; computed: EntityComputed <Entity >; methods: {} }, { state: {}; computed: { total: Signal <number > }; methods: {} }> {
85+ export function withTotalEntities<Entity >(): SignalStoreFeature <
86+ { state: {}; computed: EntityComputed <Entity >; methods: {} },
87+ { state: {}; computed: { total: Signal <number > }; methods: {} }
88+ > {
7289 return signalStoreFeature (
7390 { computed: type <EntityComputed <Entity >>() },
7491 withComputed (({ entities }) => ({
@@ -82,10 +99,18 @@ AFTER:
8299
83100``` ts
84101import { computed , Signal } from ' @angular/core' ;
85- import { signalStoreFeature , SignalStoreFeature , type , withComputed } from ' @ngrx/signals' ;
102+ import {
103+ signalStoreFeature ,
104+ SignalStoreFeature ,
105+ type ,
106+ withComputed ,
107+ } from ' @ngrx/signals' ;
86108import { EntityProps } from ' @ngrx/signals/entities' ;
87109
88- export function withTotalEntities<Entity >(): SignalStoreFeature <{ state: {}; props: EntityProps <Entity >; methods: {} }, { state: {}; props: { total: Signal <number > }; methods: {} }> {
110+ export function withTotalEntities<Entity >(): SignalStoreFeature <
111+ { state: {}; props: EntityProps <Entity >; methods: {} },
112+ { state: {}; props: { total: Signal <number > }; methods: {} }
113+ > {
89114 return signalStoreFeature (
90115 { props: type <EntityProps <Entity >>() },
91116 withComputed (({ entities }) => ({
@@ -685,15 +710,17 @@ const authApiActions = createActionGroup({
685710});
686711
687712// generated actions:
688- const { loginSuccess, loginFailure, logoutSuccess, logoutfailure } = authApiActions ;
713+ const { loginSuccess, loginFailure, logoutSuccess, logoutfailure } =
714+ authApiActions ;
689715```
690716
691717AFTER:
692718
693719The initial letter of the first word of the event name will be lowercase, and the initial letters of the other words will be uppercase. The case of other letters in the event name will remain the same.
694720
695721``` ts
696- const { logInSuccess, loginFailure, logoutSuccess, logoutFailure } = authApiActions ;
722+ const { logInSuccess, loginFailure, logoutSuccess, logoutFailure } =
723+ authApiActions ;
697724```
698725
699726- ** store:** The ` createFeature ` signature with root state is removed in favor of a signature without root state.
@@ -920,13 +947,17 @@ export class TestComponent {
920947BEFORE:
921948
922949``` html
923- <ng-container *ngrxLet =" obs$; $error as e; $complete as c" > ... </ng-container >
950+ <ng-container *ngrxLet =" obs$; $error as e; $complete as c" >
951+ ...
952+ </ng-container >
924953```
925954
926955AFTER:
927956
928957``` html
929- <ng-container *ngrxLet =" obs$; error as e; complete as c" > ... </ng-container >
958+ <ng-container *ngrxLet =" obs$; error as e; complete as c" >
959+ ...
960+ </ng-container >
930961```
931962
932963<a name =" 15.0.0-beta.1 " ></a >
@@ -2454,7 +2485,10 @@ login$ = createEffect(() =>
24542485 ofType (LoginPageActions .login ),
24552486 mapToAction (
24562487 // Happy path callback
2457- (action ) => this .authService .login (action .credentials ).pipe (map ((user ) => AuthApiActions .loginSuccess ({ user }))),
2488+ (action ) =>
2489+ this .authService
2490+ .login (action .credentials )
2491+ .pipe (map ((user ) => AuthApiActions .loginSuccess ({ user }))),
24582492 // error callback
24592493 (error ) => AuthApiActions .loginFailure ({ error })
24602494 )
@@ -2471,7 +2505,12 @@ login$ = createEffect(
24712505 ofType (LoginPageActions .login ),
24722506 mapToAction (
24732507 // Happy path callback
2474- (action ) => this .authService .login (action .credentials ).pipe (map ((user ) => AuthApiActions .loginSuccess ({ user }))),
2508+ (action ) =>
2509+ this .authService
2510+ .login (action .credentials )
2511+ .pipe (
2512+ map ((user ) => AuthApiActions .loginSuccess ({ user }))
2513+ ),
24752514 // error callback
24762515 (error ) => AuthApiActions .loginFailure ({ error })
24772516 )
@@ -2579,7 +2618,10 @@ export class AppModule {}
25792618BEFORE:
25802619
25812620``` ts
2582- const getTodosById = createSelector ((state : TodoAppSchema , id : number ) => state .todos .find ((p ) => p .id === id ));
2621+ const getTodosById = createSelector (
2622+ (state : TodoAppSchema , id : number ) =>
2623+ state .todos .find ((p ) => p .id === id )
2624+ );
25832625```
25842626
25852627AFTER:
@@ -3129,7 +3171,9 @@ Router state snapshot is returned as a SerializedRouterStateSnapshot with cyclic
31293171 After:
31303172
31313173 ``` ts
3132- actions$ .ofType (' SOME_ACTION' ).map ((action : SomeActionWithPayload ) => action .payload );
3174+ actions$
3175+ .ofType (' SOME_ACTION' )
3176+ .map ((action : SomeActionWithPayload ) => action .payload );
31333177 ```
31343178
31353179- ** ErrorHandler:** The ErrorReporter has been replaced with ErrorHandler
@@ -3334,7 +3378,13 @@ AFTER:
33343378export class AppModule {}
33353379
33363380@NgModule ({
3337- imports: [EffectsModule .forFeature ([FeatureSourceA , FeatureSourceB , FeatureSourceC ])],
3381+ imports: [
3382+ EffectsModule .forFeature ([
3383+ FeatureSourceA ,
3384+ FeatureSourceB ,
3385+ FeatureSourceC ,
3386+ ]),
3387+ ],
33383388})
33393389export class SomeFeatureModule {}
33403390```
0 commit comments