Skip to content

Commit b88f3d5

Browse files
committed
fix the persistent type failures
1 parent 44adeb8 commit b88f3d5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/bindActionCreators.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ function bindActionCreator<A extends AnyAction = AnyAction>(
44
actionCreator: ActionCreator<A>,
55
dispatch: Dispatch
66
) {
7-
return function(this: any, ...args: any[]) {
8-
return dispatch(actionCreator.apply(this, args))
7+
return function(this: any) {
8+
return dispatch(actionCreator.apply(this, (arguments as unknown) as any[]))
99
}
1010
}
1111

@@ -18,14 +18,14 @@ function bindActionCreator<A extends AnyAction = AnyAction>(
1818
* For convenience, you can also pass an action creator as the first argument,
1919
* and get a dispatch wrapped function in return.
2020
*
21-
* @param {Function|Object} actionCreators An object whose values are action
21+
* @param actionCreators An object whose values are action
2222
* creator functions. One handy way to obtain it is to use ES6 `import * as`
2323
* syntax. You may also pass a single function.
2424
*
25-
* @param {Function} dispatch The `dispatch` function available on your Redux
25+
* @param dispatch The `dispatch` function available on your Redux
2626
* store.
2727
*
28-
* @returns {Function|Object} The object mimicking the original object, but with
28+
* @returns The object mimicking the original object, but with
2929
* every action creator wrapped into the `dispatch` call. If you passed a
3030
* function as `actionCreators`, the return value will also be a single
3131
* function.

src/createStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,12 @@ export default function createStore<S, A extends Action, Ext, StateExt>(
317317
// the initial state tree.
318318
dispatch({ type: ActionTypes.INIT } as A)
319319

320-
const store: Store<S, A> = {
320+
const store: Store<S, A> = ({
321321
dispatch: dispatch as Dispatch<A>,
322322
subscribe,
323323
getState,
324324
replaceReducer,
325325
[$$observable]: observable
326-
}
326+
} as unknown) as Store<S, A>
327327
return store
328328
}

0 commit comments

Comments
 (0)