今日はredux-actions(記載時点ではv2.0.1)という公式推奨パッケージを使って、 reduxのactionとreducerを楽にスッキリ書く方法を紹介します。 追記:現在は公式のドキュメントができているので、こちらを参照するとより確実です。 https://redux-actions.js.org/docs/api/index.html アクションの形式 reducerを書く際に下記の形式(※1)を知っている必要があります。 { type : {symbol|string}, // アクションタイプ payload : {any}, // メインの情報 error : {boolean}, // エラーかどうか meta : {any}, // payloadに乗らなかった情報 } import { createActions } from 'redux-actions';