@@ -6,6 +6,11 @@ export interface Todo {
66 title : string
77}
88
9+ // This only included to make sure the codemod does not
10+ // throw a runtime error when faced with TS 4.7+ syntax such as
11+ // the `satisfies` operator and instantiation expressions
12+ const someString = 'someString' satisfies string
13+
914export const todoAdapter = createEntityAdapter < Todo > ( )
1015
1116const todoInitialState = todoAdapter . getInitialState ( )
@@ -18,21 +23,25 @@ createReducer(todoInitialState, {
1823 [ todoAdded1a ] : ( state : TodoSliceState , action : PayloadAction < string > ) => {
1924 // stuff
2025 } ,
21- [ todoAdded1b ] : ( state : TodoSliceState , action : PayloadAction < string > ) => action . payload ,
22- [ todoAdded1c + 'test' ] : ( state :TodoSliceState , action : PayloadAction < string > ) => {
26+ [ todoAdded1b ] : ( state : TodoSliceState , action : PayloadAction < string > ) =>
27+ action . payload ,
28+ [ todoAdded1c + 'test' ] : ( state : TodoSliceState , action : PayloadAction < string > ) => {
2329 // stuff
2430 } ,
2531 [ todoAdded1d ] ( state : TodoSliceState , action : PayloadAction < string > ) {
2632 // stuff
2733 } ,
28- [ todoAdded1e ] : function ( state : TodoSliceState , action : PayloadAction < string > ) {
34+ [ todoAdded1e ] : function (
35+ state : TodoSliceState ,
36+ action : PayloadAction < string >
37+ ) {
2938 // stuff
3039 } ,
3140 todoAdded1f : ( state : TodoSliceState , action : PayloadAction < string > ) => {
3241 //stuff
3342 } ,
3443 [ todoAdded1g ] : addOne ,
35- todoAdded1h : todoAdapter . addOne ,
44+ todoAdded1h : todoAdapter . addOne
3645} )
3746
3847createReducer ( todoInitialState , {
@@ -42,7 +51,10 @@ createReducer(todoInitialState, {
4251 [ todoAdded2b ] ( state : TodoSliceState , action : PayloadAction < string > ) {
4352 // stuff
4453 } ,
45- [ todoAdded2c ] : function ( state : TodoSliceState , action : PayloadAction < string > ) {
54+ [ todoAdded2c ] : function (
55+ state : TodoSliceState ,
56+ action : PayloadAction < string >
57+ ) {
4658 // stuff
4759 }
4860} )
0 commit comments