Skip to content

Commit

Permalink
🐛 Fix invalid TS typings for typed dispatch props
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoLegends committed Dec 26, 2017
1 parent 9b3c908 commit 0e5e00a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fit-html",
"version": "0.3.0",
"version": "0.3.1",
"description": "5KB functional Web Components without bloat",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ export { html };
* @returns {FitElement<S, SP & DP, OP>} A newly created 💪-element.
* @template S, SP, DP, OP
*/
export default function connect<S, SP, DP extends ActionCreatorsMapObject, OP = {}>(
export default function connect<S, SP, DP, OP = {}>(
mapStateToProps: MapStateToPropsFn<S, SP, OP>,
mapDispatchToProps: MapDispatchToPropsFn<S, DP, OP> | DP,
templateFn: (props: SP & DP) => TemplateResult
): FitElement<S, SP & DP, OP> {
return class extends HTMLElement {
_preparedDispatch: MapDispatchToPropsFn<S, DP, OP> | DP;
_preparedDispatch: MapDispatchToPropsFn<S, DP, OP> | ActionCreatorsMapObject;
_renderEnqueued: boolean = false;
_store: Store<S>;
_unsubscribe: Unsubscribe;
Expand All @@ -95,7 +95,7 @@ export default function connect<S, SP, DP extends ActionCreatorsMapObject, OP =
const store = this.getStore();
this._preparedDispatch = isFunction(mapDispatchToProps)
? mapDispatchToProps
: bindActionCreators(mapDispatchToProps, store.dispatch);
: bindActionCreators(mapDispatchToProps as any as ActionCreatorsMapObject, store.dispatch);
this._unsubscribe = store.subscribe(() => this.enqueueRender());

this.enqueueRender();
Expand Down

0 comments on commit 0e5e00a

Please sign in to comment.