Keep store type in updateState
Closed this issue · 2 comments
brennohv commented
I've noticed that when we use updateState it loses the store type, example:
Meanwhile I got around this issue by encapsulating your function like this.
import { updateState } from '@angular-architects/ngrx-toolkit';
import { PartialStateUpdater, StateSignal } from '@ngrx/signals';
import { Prettify } from '@ngrx/signals/src/ts-helpers';
export function updateStateLib<State extends object>(
stateSignal: StateSignal<State>,
message: string,
...updaters: Array<
Partial<Prettify<State>> | PartialStateUpdater<Prettify<State>>
>
) {
updateState(stateSignal, message, ...updaters);
}
rainerhahnekamp commented
@brennohv that should fixed, in the latest version. could you please check?
brennohv commented
It's fixed