File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,7 @@ import { useSelector, useDispatch } from 'react-redux'
33import { actions } from '../../redux/actions/counter'
44import { selectors } from '../../redux/selectors/counter'
55
6- interface IUseCounter {
7- counter : number
8- handleDecrement : ( ) => void
9- handleIncrement : ( ) => void
10- }
11-
12- export function useCounter ( ) : IUseCounter {
6+ export function useCounter ( ) {
137 const counter = useSelector ( selectors . getCounter )
148 const dispatch = useDispatch ( )
159
Original file line number Diff line number Diff line change 11import { actionTypes } from '../constants/counter'
22
3- interface IAction {
3+ type Action = {
44 type : 'COUNTER_DECREMENT' | 'COUNTER_INCREMENT'
55}
66
77const INITIAL_STATE = {
88 counter : 0
99}
1010
11- export const counterReducers = ( state = INITIAL_STATE , action : IAction ) => {
11+ export const counterReducers = ( state = INITIAL_STATE , action : Action ) => {
1212 switch ( action . type ) {
1313 case actionTypes . COUNTER_DECREMENT :
1414 return {
You can’t perform that action at this time.
0 commit comments