File tree 1 file changed +7
-11
lines changed
libs/ngrx-toolkit/src/lib
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';
9
9
10
10
export type CallState = 'init' | 'loading' | 'loaded' | { error : string } ;
11
11
12
- export type NamedCallStateSlice < Collection extends string > = {
13
- [ K in Collection as `${K } CallState`] : CallState ;
14
- } ;
15
-
16
12
export type CallStateSlice = {
17
13
callState : CallState
18
14
}
19
15
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
+ }
27
19
28
20
export type CallStateSignals = {
29
21
loading : Signal < boolean > ;
30
22
loaded : Signal < boolean > ;
31
23
error : Signal < string | null >
32
24
}
33
25
26
+ export type NamedCallStateSignals < Prop extends string > = {
27
+ [ K in keyof CallStateSignals as `${Prop } ${Capitalize < K > } `] : CallStateSignals [ K ] ;
28
+ }
29
+
34
30
export type SetCallState < Prop extends string | undefined > = Prop extends string
35
31
? NamedCallStateSlice < Prop >
36
32
: CallStateSlice ;
You can’t perform that action at this time.
0 commit comments