angular-architects/ngrx-toolkit

Keep store type in updateState

Closed this issue · 2 comments

I've noticed that when we use updateState it loses the store type, example:
image

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);
} 

image

@brennohv that should fixed, in the latest version. could you please check?

It's fixed