Created
May 21, 2018 00:22
-
-
Save zerobias/5143a2ac96d714ea6e5002d201a28631 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
export type ExtractReturn<Fn> = $Call<<T>((...Iterable<any>) => T) => T, Fn>; | |
//example | |
const mapDispatchToProps = (dispatch: Dispatch) => ({ | |
actions: { | |
setCompany: ({ companyId, domainName }) => | |
dispatch( | |
setCompany({ | |
companyId, | |
domainName, | |
}), | |
), | |
}, | |
}); | |
type ReduxActions = ExtractReturn<typeof mapDispatchToProps>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment