File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
libs/ngrx-toolkit/src/lib Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -9,28 +9,24 @@ import { Emtpy } from './shared/empty';
99
1010export type CallState = 'init' | 'loading' | 'loaded' | { error : string } ;
1111
12- export type NamedCallStateSlice < Collection extends string > = {
13- [ K in Collection as `${K } CallState`] : CallState ;
14- } ;
15-
1612export type CallStateSlice = {
1713 callState : CallState
1814}
1915
20- export type NamedCallStateSignals < Prop extends string > = {
21- [ K in Prop as `${K } Loading`] : Signal < boolean > ;
22- } & {
23- [ K in Prop as `${K } Loaded`] : Signal < boolean > ;
24- } & {
25- [ K in Prop as `${K } Error`] : Signal < string | null > ;
26- }
16+ export type NamedCallStateSlice < Collection extends string > = {
17+ [ K in keyof CallStateSlice as `${Collection } ${Capitalize < K > } `] : CallStateSlice [ K ] ;
18+ }
2719
2820export type CallStateSignals = {
2921 loading : Signal < boolean > ;
3022 loaded : Signal < boolean > ;
3123 error : Signal < string | null >
3224}
3325
26+ export type NamedCallStateSignals < Prop extends string > = {
27+ [ K in keyof CallStateSignals as `${Prop } ${Capitalize < K > } `] : CallStateSignals [ K ] ;
28+ }
29+
3430export type SetCallState < Prop extends string | undefined > = Prop extends string
3531 ? NamedCallStateSlice < Prop >
3632 : CallStateSlice ;
You can’t perform that action at this time.
0 commit comments