Skip to content

Instantly share code, notes, and snippets.

@aibolik
Created August 2, 2017 10:05
Show Gist options
  • Select an option

  • Save aibolik/c86d25a90d8c0ad86debf70c91c2d0e2 to your computer and use it in GitHub Desktop.

Select an option

Save aibolik/c86d25a90d8c0ad86debf70c91c2d0e2 to your computer and use it in GitHub Desktop.
class StoreManager extends React.Component {
constructor(props){
super(props)
}
componentWillReceiveProps(newProps){
if(newProps.hash !== this.props.hash){
newProps.onUpdate()
}
}
componentWillUnmount(){
this.props.clean()
}
componentWillMount(){
if(this.props.start){
this.props.start()
}
}
render(){
return this.props.children
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment