mirror of
https://github.com/streamich/react-use.git
synced 2026-01-25 14:17:16 +00:00
style: don't shadow variable
This commit is contained in:
parent
72e3036b15
commit
17036105ad
@ -4,7 +4,6 @@ import logger from 'redux-logger';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import { createReducer } from '..';
|
||||
// import ShowDocs from './util/ShowDocs';
|
||||
|
||||
const useThunkReducer = createReducer(thunk, logger);
|
||||
|
||||
@ -29,11 +28,11 @@ function reducer(state, action) {
|
||||
const Demo = ({ initialCount = 1 }) => {
|
||||
// Action creator to increment count, wait a second and then reset
|
||||
const addAndReset = React.useCallback(() => {
|
||||
return dispatch => {
|
||||
dispatch({ type: 'increment' });
|
||||
return dispatch2 => {
|
||||
dispatch2({ type: 'increment' });
|
||||
|
||||
setTimeout(() => {
|
||||
dispatch({ type: 'reset', payload: initialCount });
|
||||
dispatch2({ type: 'reset', payload: initialCount });
|
||||
}, 1000);
|
||||
};
|
||||
}, [initialCount]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user