File tree 2 files changed +3
-9
lines changed
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'
3
3
import { actions } from '../../redux/actions/counter'
4
4
import { selectors } from '../../redux/selectors/counter'
5
5
6
- interface IUseCounter {
7
- counter : number
8
- handleDecrement : ( ) => void
9
- handleIncrement : ( ) => void
10
- }
11
-
12
- export function useCounter ( ) : IUseCounter {
6
+ export function useCounter ( ) {
13
7
const counter = useSelector ( selectors . getCounter )
14
8
const dispatch = useDispatch ( )
15
9
Original file line number Diff line number Diff line change 1
1
import { actionTypes } from '../constants/counter'
2
2
3
- interface IAction {
3
+ type Action = {
4
4
type : 'COUNTER_DECREMENT' | 'COUNTER_INCREMENT'
5
5
}
6
6
7
7
const INITIAL_STATE = {
8
8
counter : 0
9
9
}
10
10
11
- export const counterReducers = ( state = INITIAL_STATE , action : IAction ) => {
11
+ export const counterReducers = ( state = INITIAL_STATE , action : Action ) => {
12
12
switch ( action . type ) {
13
13
case actionTypes . COUNTER_DECREMENT :
14
14
return {
You can’t perform that action at this time.
0 commit comments