Skip to content

Instantly share code, notes, and snippets.

Created October 17, 2016 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/924c22eaeb23e921e0bd7d9f508abfa5 to your computer and use it in GitHub Desktop.
Save anonymous/924c22eaeb23e921e0bd7d9f508abfa5 to your computer and use it in GitHub Desktop.
class Parent extends Component{
componentDidMount(){
this.props.getAllEvents() // loads all data
}
render(){
return(
<Alerts data={events} />
<Messages data={events} />
)
}
}
export connect(null,actions)(Parent)
const Allerts = ({alerts}) =>
// render {alerts}
const selector =(state) =>({
alerts: selectors.alerts(state)
})
export connect(selector)(Alerts);
const selectors = (state) =>
state.allevents.filter(f => f.type == 'alert');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment