React Redux createStore 適当訳
createStore(reducer, [initialState], [enhancer])
reducer (Function): A reducing function that returns the next state tree, given the current state tree and an action to handle.
reducer とは state を返す 関数で 現在のstate と 操作するための action を引数とするものである。
[initialState] (any): The initial state. You may optionally specify it to hydrate the state from the server in universal apps, or to restore a previously serialized user session. If you produced reducer with combineReducers, this must be a plain object with the same shape as the keys passed to it. Otherwise, you are free to pass anything that your reducer can understand.
stateの初期状態。
[enhancer] (Function): The store enhancer. You may optionally specify it to enhance the store with third-party capabilities such as middleware, time travel, persistence, etc. The only store enhancer that ships with Redux is applyMiddleware().
store 増強剤(?)
Store
アプリケーション全体の store tree を保持する。
stateを変更する唯一の方法はactionをディスパッチすることである。
storeはクラスではなく、いくつかのメソッドを持った関数である。
storeを作成するためには createStore に root reducing function を渡す。
入門 React ―コンポーネントベースのWebフロントエンド開発
- 作者: Frankie Bagnardi,Jonathan Beebe,Richard Feldman,Tom Hallett,Simon HØjberg,Karl Mikkelsen,宮崎空
- 出版社/メーカー: オライリージャパン
- 発売日: 2015/04/03
- メディア: 大型本
- この商品を含むブログ (2件) を見る