When trying to use withCallState in a signalStore and using patchState with the setter-functions, typescript will complain unless your store satisfies both NamedCallStateSlice<Prop> and CallStateSlice even if you only really get one of the two objects back. With this you should get conditional typing based on the input and not the union type of NamedCallStateSlice<Prop> and CallStateSlice.
E.g setLoading('flights') should give the type NamedCallStateSlice<'flights'> and not NamedCallStateSlice<'flights'> | CallStateSlice.
I appreciate any response as I think this would be nice if using withCallState for requests without withDataService.
When trying to use
withCallState
in asignalStore
and usingpatchState
with the setter-functions, typescript will complain unless your store satisfies bothNamedCallStateSlice<Prop>
andCallStateSlice
even if you only really get one of the two objects back. With this you should get conditional typing based on the input and not the union type ofNamedCallStateSlice<Prop>
andCallStateSlice
.E.g
setLoading('flights')
should give the typeNamedCallStateSlice<'flights'>
and notNamedCallStateSlice<'flights'> | CallStateSlice
.I appreciate any response as I think this would be nice if using
withCallState
for requests withoutwithDataService
.