UNPKG

384 BMarkdownView Raw
1## Actions
2
3One of the ways to change state is with actions. Every action is regular class method that has been decorated with `@action` decorator. It must return state changes to modify state.
4
5```js
6@action
7rename() {
8 return {
9 name: 'Steve'
10 }
11}
12```
13
14State is always immutable. Do not mutate it without returning state change in action. DOM will not be re-rendered that way.