Skip to content

Instantly share code, notes, and snippets.

@actarian
Created December 16, 2019 15:37
Show Gist options
  • Save actarian/2eeb9fe6449e370d43482013aaeacfde to your computer and use it in GitHub Desktop.
Save actarian/2eeb9fe6449e370d43482013aaeacfde to your computer and use it in GitHub Desktop.
RxComp - LifeCycle Hooks
class MyComponent extends Component {
/**
* MyComponent instance has been initialized
* we can add custom properties to the instance
*/
onInit() {
// ...
}
/**
* OnPush Strategy update method has been called
* we receive changes from parent instance
*/
onChanges(changes) {
// ...
}
/**
* Current instance template has been parsed
* we can handle child html nodes
*/
onView() {
// ...
}
/**
* MyComponent instance has been destroyed
* we can dispose all custom created references
*/
onDestroy() {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment