0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Reduxを学んだ(1) ~StateとActionとReducer~

Posted at
  • この記事は自分のメモでしかないので、正確さは全く保障されておりません。

ReduxでのState管理とそのインターフェイス

image.png

Actionについて

image.png

  • ActionCreatorを使ってActionを作成する

Reducerについて

以下のルールを設けた上で

  • Only an event can change the state of the store.
  • The function that returns the new state needs to be a pure function.

State + Action --(Reducer)--> newState という設計が用いられている。

image.png

  • 複数のreducerは以下のように連結できる

image.png

[補足]Reducerは、pure functionであるべきである

image.png

参考

  • 画像はUdacityのBecome a React Developerコースのコンテンツから引用している。本文の内容に関しても、同コンテンツを大いに参考にしている。

その他

自分の書いたReactの学習メモは: Reactを学んだ(1) ~StateとProps~

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?