GitHubのfacebook/fluxのexampleに以下のようなコードがありました。JavaScriptでは、なかなか見かけない書き方だと思うんですが、どんな意味なのか教えていただきたいです。調べても手がかりすらなくモヤモヤしています。
特に以下の部分が不明です。
・type Actionの部分(特にtypeは何なのか?)
・|(パイプ)でオブジェクトを繋げている部分
javascript
1'use strict'; 2 3export type Action = 4 { 5 type: 'todo/complete', 6 id: string, 7 } | 8 { 9 type: 'todo/create', 10 text: string, 11 } | 12 { 13 type: 'todo/destroy', 14 id: string, 15 } | 16 { 17 type: 'todo/destroy-completed', 18 } | 19 { 20 type: 'todo/toggle-complete-all', 21 } | 22 { 23 type: 'todo/undo-complete', 24 id: string, 25 } | 26 { 27 type: 'todo/update-text', 28 id: string, 29 text: string, 30 };
お願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/01/31 05:26