From aa8423aab0495317f6ac190bb4a52359c847862c Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Wed, 11 Oct 2017 11:25:09 +0800 Subject: [PATCH] stencil: add lifecycle hooks example --- stencil.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stencil.md b/stencil.md index f3853976a..3c07c5736 100644 --- a/stencil.md +++ b/stencil.md @@ -169,6 +169,8 @@ See: [Slots](https://stenciljs.com/docs/templating#slots) ## Lifecycle +### Lifecycle hooks + | Event | Description | | --- | --- | | `componentWilLLoad()` | Before rendering | @@ -181,6 +183,16 @@ See: [Slots](https://stenciljs.com/docs/templating#slots) See: [Component lifecycle](https://stenciljs.com/docs/component-lifecycle) +### Example + +```js +export class MyComponent { + componentWillUpdate () { + console.log('updating') + } +} +``` + ## References - [Stencil docs](https://stenciljs.com/docs/) _(stenciljs.com)_