File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,15 @@ describe('createAction()', () => {
39
39
expectSnippet ( `
40
40
const foo = createAction('FOO', props<{ type: number }>());
41
41
` ) . toFail (
42
- / A r g u m e n t o f t y p e ' " t y p e p r o p e r t y i s n o t a l l o w e d i n a c t i o n c r e a t o r s " ' i s n o t a s s i g n a b l e t o p a r a m e t e r o f t y p e /
42
+ / T y p e ' P r o p s < \{ t y p e : n u m b e r ; \} > ' i s n o t a s s i g n a b l e t o t y p e ' " t y p e p r o p e r t y i s n o t a l l o w e d i n a c t i o n c r e a t o r s " ' /
43
43
) ;
44
44
} ) ;
45
45
46
46
it ( 'should not allow ararys' , ( ) => {
47
47
expectSnippet ( `
48
48
const foo = createAction('FOO', props<[]>());
49
49
` ) . toFail (
50
- / A r g u m e n t o f t y p e ' " a r r a y s a r e n o t a l l o w e d i n a c t i o n c r e a t o r s " ' i s n o t a s s i g n a b l e t o p a r a m e t e r o f t y p e /
50
+ / T y p e ' P r o p s < \[ \] > ' i s n o t a s s i g n a b l e t o t y p e ' " a r r a y s a r e n o t a l l o w e d i n a c t i o n c r e a t o r s " ' /
51
51
) ;
52
52
} ) ;
53
53
} ) ;
@@ -80,15 +80,15 @@ describe('createAction()', () => {
80
80
expectSnippet ( `
81
81
const foo = createAction('FOO', (type: string) => ({type}));
82
82
` ) . toFail (
83
- / T y p e ' { t y p e : s t r i n g ; } ' i s n o t a s s i g n a b l e t o t y p e ' " t y p e p r o p e r t y i s n o t a l l o w e d i n a c t i o n c r e a t o r s " ' /
83
+ / T y p e ' \( t y p e : s t r i n g \) = > \ { t y p e : s t r i n g ; \ }' i s n o t a s s i g n a b l e t o t y p e ' " t y p e p r o p e r t y i s n o t a l l o w e d i n a c t i o n c r e a t o r s " ' /
84
84
) ;
85
85
} ) ;
86
86
87
87
it ( 'should not allow arrays' , ( ) => {
88
88
expectSnippet ( `
89
89
const foo = createAction('FOO', () => [ ]);
90
90
` ) . toFail (
91
- / T y p e ' a n y \[ ] ' i s n o t a s s i g n a b l e t o t y p e ' " a r r a y s a r e n o t a l l o w e d i n a c t i o n c r e a t o r s " ' /
91
+ / T y p e ' \( \) = > a n y \[ \ ]' i s n o t a s s i g n a b l e t o t y p e ' " a r r a y s a r e n o t a l l o w e d i n a c t i o n c r e a t o r s " ' /
92
92
) ;
93
93
} ) ;
94
94
} ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ export const compilerOptions = () => ({
2
2
moduleResolution : 'node' ,
3
3
target : 'es2015' ,
4
4
baseUrl : '.' ,
5
+ experimentalDecorators : true ,
5
6
paths : {
6
7
'@ngrx/store' : [ './modules/store' ] ,
7
8
} ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export function createAction<T extends string>(
15
15
) : ActionCreator < T , ( ) => TypedAction < T > > ;
16
16
export function createAction < T extends string , P extends object > (
17
17
type : T ,
18
- config : Props < P >
18
+ config : Props < P > & NotAllowedCheck < P >
19
19
) : ActionCreator < T , ( props : P & NotAllowedCheck < P > ) => P & TypedAction < T > > ;
20
20
export function createAction <
21
21
T extends string ,
You can’t perform that action at this time.
0 commit comments