Last active
March 10, 2018 09:49
-
-
Save craftzdog/21681b2d5e4089ad04a477531556a860 to your computer and use it in GitHub Desktop.
Wrap redux's connect function as recompose's HOC - https://medium.com/@inkdrop/making-hoc-with-prop-type-inference-from-recompose-and-redux-connector-in-flow-4553e9d2c062
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import { type HOC } from 'recompose' | |
import { connect } from 'react-redux' | |
import type { Dispatch } from '../types' | |
type CHOC<E: {}> = HOC<{ ...$Exact<E>, dispatch: Dispatch }, E> | |
export default function getDispatch<Enhanced: {}>(): CHOC<Enhanced> { | |
return (connect(): Function) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment