Created
August 2, 2017 10:05
-
-
Save aibolik/c86d25a90d8c0ad86debf70c91c2d0e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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