Skip to content

Instantly share code, notes, and snippets.

@thekevinscott
Last active August 8, 2016 12:59
Show Gist options
  • Save thekevinscott/6179b6b6966511ba7bc75c9ecff376bb to your computer and use it in GitHub Desktop.
Save thekevinscott/6179b6b6966511ba7bc75c9ecff376bb to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { connect } from 'react-redux';
function getWrappedComponent(
component,
[
mapStateToProps,
mapDispatchToProps,
mergeProps,
options,
],
) {
return connect(
mapStateToProps,
mapDispatchToProps,
mergeProps,
options,
)(component);
}
const patchedConnect = (...args) => component => {
return getWrappedComponent(component, args);
};
export default patchedConnect;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment