File tree 2 files changed +12
-10
lines changed
client/modules/IDE/reducers
2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ const searchSlice = createSlice({
9
9
name : 'search' ,
10
10
initialState,
11
11
reducers : {
12
- setSearchTerm : ( state , action ) => {
13
- const { scope , query } = action . payload ;
14
- return {
15
- ... state ,
16
- [ ` ${ scope } SearchTerm` ] : query
17
- } ;
12
+ setSearchTerm : {
13
+ reducer : ( state , action ) => {
14
+ const { scope , query } = action . payload ;
15
+ state [ ` ${ scope } SearchTerm` ] = query ;
16
+ } ,
17
+ prepare : ( scope , query ) => ( { payload : { scope , query } } )
18
18
}
19
19
}
20
20
} ) ;
Original file line number Diff line number Diff line change @@ -20,10 +20,12 @@ const sortingSlice = createSlice({
20
20
state . direction === DIRECTION . ASC ? DIRECTION . DESC : DIRECTION . ASC ;
21
21
return { ...state , direction } ;
22
22
} ,
23
- setSorting : ( state , action ) => {
24
- const { field, direction } = action . payload ;
25
- console . log ( field ) ;
26
- return { ...state , field, direction } ;
23
+ setSorting : {
24
+ reducer : ( state , action ) => {
25
+ const { field, direction } = action . payload ;
26
+ return { ...state , field, direction } ;
27
+ } ,
28
+ prepare : ( field , direction ) => ( { payload : { field, direction } } )
27
29
}
28
30
}
29
31
} ) ;
You can’t perform that action at this time.
0 commit comments