Skip to content

Commit

Permalink
docs(readme): add infor about dispatching @rwc/event/*
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Sep 8, 2016
1 parent 578cc7f commit eec77cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -190,6 +190,7 @@ export const update = (state, {type, params}) => {
- `@@rwc/created`: Fired when the web component is initialized. The `params` for this action is the instance of the web component.
- `@@rwc/attached`: Dispatched when the web component is inserted into the DOM. This is a good time to call something like `params.getBoundingClientRect()` to get the dimensions of the web component and keep it in the state.
- `@@rwc/detached`: Dispatched when the component is removed from the DOM.
- `@@rwc/event/<event name>`: Whenever an [Event] type is returned from the `update` function, this action is automatically fired.
- `@@rwc/attr/<attr name>`: This is fired whenever a web component's attribute is changed. The `param` is the current value of the attribute.
- `@@rwc/prop/<prop name>`: Attributes have a limitation of passing data that is of `string` type only. For this purpose you can predefine some `props` that `rwc` will attach hooks on and whenever they are changed, this particular action will be fired.
```js
Expand Down
1 change: 1 addition & 0 deletions docs/README.template.md
Expand Up @@ -190,6 +190,7 @@ export const update = (state, {type, params}) => {
- `@@rwc/created`: Fired when the web component is initialized. The `params` for this action is the instance of the web component.
- `@@rwc/attached`: Dispatched when the web component is inserted into the DOM. This is a good time to call something like `params.getBoundingClientRect()` to get the dimensions of the web component and keep it in the state.
- `@@rwc/detached`: Dispatched when the component is removed from the DOM.
- `@@rwc/event/<event name>`: Whenever an [Event] type is returned from the `update` function, this action is automatically fired.
- `@@rwc/attr/<attr name>`: This is fired whenever a web component's attribute is changed. The `param` is the current value of the attribute.
- `@@rwc/prop/<prop name>`: Attributes have a limitation of passing data that is of `string` type only. For this purpose you can predefine some `props` that `rwc` will attach hooks on and whenever they are changed, this particular action will be fired.
```js
Expand Down

0 comments on commit eec77cd

Please sign in to comment.