Skip to content

Instantly share code, notes, and snippets.

@hartzis
Last active May 14, 2016 21:59
Show Gist options
  • Save hartzis/4c6a834e60cb0099edff to your computer and use it in GitHub Desktop.
Save hartzis/4c6a834e60cb0099edff to your computer and use it in GitHub Desktop.
import {connect} from 'react-redux';
import {compose, withPropsOnChange} from 'recompose';
import View from './Scientist.jsx';
export default compose(
connect((state, props)=>{
return {
...state.scientists.get(props.scientist),
};
}),
withPropsOnChange(['dob', 'image'], ({dob, image})=>{
return {
dob: getFormattedDOB(dob),
imageSrc: `http://imagecdn.com/scientists/${image}`,
};
})
)(View);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment