diff --git a/src/hooks/useCounter/index.tsx b/src/hooks/useCounter/index.tsx index 3630ba1..2c6874a 100644 --- a/src/hooks/useCounter/index.tsx +++ b/src/hooks/useCounter/index.tsx @@ -3,13 +3,7 @@ import { useSelector, useDispatch } from 'react-redux' import { actions } from '../../redux/actions/counter' import { selectors } from '../../redux/selectors/counter' -interface IUseCounter { - counter: number - handleDecrement: () => void - handleIncrement: () => void -} - -export function useCounter (): IUseCounter { +export function useCounter () { const counter = useSelector(selectors.getCounter) const dispatch = useDispatch() diff --git a/src/redux/reducers/counter.ts b/src/redux/reducers/counter.ts index f07228b..6ef948c 100644 --- a/src/redux/reducers/counter.ts +++ b/src/redux/reducers/counter.ts @@ -1,6 +1,6 @@ import { actionTypes } from '../constants/counter' -interface IAction { +type Action = { type: 'COUNTER_DECREMENT' | 'COUNTER_INCREMENT' } @@ -8,7 +8,7 @@ const INITIAL_STATE = { counter: 0 } -export const counterReducers = (state = INITIAL_STATE, action: IAction) => { +export const counterReducers = (state = INITIAL_STATE, action: Action) => { switch (action.type) { case actionTypes.COUNTER_DECREMENT: return {