1- import { createAsyncThunk , createSlice , PayloadAction } from '@reduxjs/toolkit' ;
2- import { RootState } from '../../app/store' ;
3- import { fetchCount } from './counterAPI' ;
1+ import { createAsyncThunk , createSlice , PayloadAction } from '@reduxjs/toolkit' ;
2+ import { RootState } from '../../app/store' ;
3+ import { fetchCount } from './counterAPI' ;
44
55interface CounterState {
66 value : number ;
@@ -19,9 +19,9 @@ const initialState: CounterState = {
1919export const incrementAsync = createAsyncThunk <
2020 number ,
2121 number ,
22- { state : { counter : CounterState } }
23- > ( 'counter/fetchCount' , async ( amount : number , { getState} ) => {
24- const { value} = getState ( ) . counter ;
22+ { state : { counter : CounterState } }
23+ > ( 'counter/fetchCount' , async ( amount : number , { getState } ) => {
24+ const { value } = getState ( ) . counter ;
2525 const response = await fetchCount ( value , amount ) ;
2626 return response . data ;
2727} ) ;
@@ -57,7 +57,7 @@ export const counterSlice = createSlice({
5757 } ,
5858} ) ;
5959
60- export const { increment, decrement, incrementByAmount} = counterSlice . actions ;
60+ export const { increment, decrement, incrementByAmount } = counterSlice . actions ;
6161
6262// The function below is called a selector and allows us to select a value from
6363// the state. Selectors can also be defined inline where they're used instead of
0 commit comments