fix: fix TypeScript error

This commit is contained in:
Vadim Dalecky 2019-06-02 07:15:39 +02:00 committed by GitHub
parent 6ba2d93700
commit 72e3036b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ function composeMiddleware(chain) {
const createReducer = (...middlewares) => (reducer, initialState, initializer = value => value) => {
const ref = useRef(initializer(initialState))
const [, setState] = useState(ref.current)
let middlewareDispatch = () => {
let middlewareDispatch = (_ = {}) => {
throw new Error(
'Dispatching while constructing your middleware is not allowed. ' +
'Other middleware would not be applied to this dispatch.'