## 五、Action
每個Action都是一個對象,包含一個`actionType`屬性(說明動作的類型)和一些其他屬性(用來傳遞數據)。
在這個Demo里面,[`ButtonActions`](https://github.com/ruanyf/extremely-simple-flux-demo/blob/master/actions/ButtonActions.js)?對象用于存放所有的Action。
> ~~~
> // actions/ButtonActions.js
> var AppDispatcher = require('../dispatcher/AppDispatcher');
>
> var ButtonActions = {
> addNewItem: function (text) {
> AppDispatcher.dispatch({
> actionType: 'ADD_NEW_ITEM',
> text: text
> });
> },
> };
> ~~~
上面代碼中,`ButtonActions.addNewItem`方法使用`AppDispatcher`,把動作`ADD_NEW_ITEM`派發到Store。