Overview
Essentials
- Installation
- Introduction
- Defining a Component
- Property Decorators
- Manipulating DOM
Reusability
- Composition
- Custom Decorators
Architecture
- Event Handling
- State Management
Internals
- Component Lifecycle
- Initialisation Process
Tooling
- Debugging
- Deployment
- CLI
Miscellaneous
- Migration from Strudel 0.x
- Style Guide
Component lifecycle
The lifecycle of a web page
There are certain events in the life of a web application. The obvious ones are related to the lifecycle of a page - DOM ready, everything loaded, page aborted. The components on the page needs to fit into this lifecycle, so Strudel provides hooks that allow to react on key events.
Component lifecycle
Diagram below presents full component lifecycle and what hooks are available in which phase of the life of component. All the hooks are simply methods that when definied in a component under the certain name, will be run at the certain event in the lifecycle.
The most useful hooks to use in components are:
init
- most commonly used, code will be run when page is ready to usedestroy
- code will be run when component is removed from a page or when$teardown
is explicitly called
Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!