Skip to content

Instantly share code, notes, and snippets.

@dagda1
Last active June 18, 2018 17:58
Show Gist options
  • Select an option

  • Save dagda1/bc75baed00a408857d010cc6bcd87b78 to your computer and use it in GitHub Desktop.

Select an option

Save dagda1/bc75baed00a408857d010cc6bcd87b78 to your computer and use it in GitHub Desktop.
export type MapMapStateToProps<T, K extends keyof T, S> = MapStateToProps<Pick<T, K>, Exclude<T, K>, S>;
// usage
const mapStateToProps: MapMapStateToProps<MyComponentProps, 'someProp' | 'andAnother', State> = state => ({
someProp: selector(state),
andAnother: anotherSelector(state)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment