Skip to content

Instantly share code, notes, and snippets.

@iamdey
Created November 24, 2017 08:31
Show Gist options
  • Save iamdey/985f2f4d5229ceefe5b9d4fb6459b428 to your computer and use it in GitHub Desktop.
Save iamdey/985f2f4d5229ceefe5b9d4fb6459b428 to your computer and use it in GitHub Desktop.
currentab
import { createSelector } from 'reselect';
import { connect } from 'react-redux';
import { currentTabSelector } from '../store/selectors/tab';
const mapStateToProps = createSelector(
[currentTabSelector],
currentTab => ({
currentTab,
})
);
const withCurrentTab = () => Component => connect(mapStateToProps)(Component);
export { withCurrentTab };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment