Skip to content

Instantly share code, notes, and snippets.

@MicroBenz
Created December 3, 2017 16:25
Show Gist options
  • Save MicroBenz/604491a61ed2e5086912452cf3163eff to your computer and use it in GitHub Desktop.
Save MicroBenz/604491a61ed2e5086912452cf3163eff to your computer and use it in GitHub Desktop.
Recompose
import React from 'react';
import { conenct } from 'react-redux';
import { compose } from 'recompose';
const enhance = compose(
connect(
state => ({
campers: state.campers.lists
})
)
);
const Campers = props => {
const { campers = [] } = props;
return (
<div>
<CamperTable lists={campers.filter(camper => camper.role === 'design')} />
<CamperTable lists={campers.filter(camper => camper.role === 'marketing')} />
<CamperTable lists={campers.filter(camper => camper.role === 'programming')} />
<CamperTable lists={campers.filter(camper => camper.role === 'content')} />
</div>
);
};
export default enhance(Campers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment