Open rainerhahnekamp opened 10 months ago
This would work with the proposal of https://github.com/angular-architects/ngrx-toolkit/issues/8.
It could allow you to use the same createReducer
from @ngrx/store
. Just like this approach:
https://github.com/rosostolato/ngrx-signals-redux/blob/master/src/app/state/posts/posts.reducer.ts
https://github.com/rosostolato/ngrx-signals-redux/blob/master/src/app/state/posts/posts.store.ts
So #8 is about adding a dependency to @ngrx/store. This is here is about the native version which only requires the Signal Store as dependency.
The
on
method can accept the patched state as return type of the reducer function.At the moment, it goes like this:
The new version could look like this:
Or if the state doesn't require the payload: