File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,20 +101,20 @@ export default function createLogger(options = defaultOptions) {
101101` return ` している高階関数の連なりが _ Middleware_ の本体となります。
102102
103103``` js
104- const middleware = store => next => action => {}
104+ const middleware = store => next => action => {};
105105```
106106
107107上記のArrowFunctionの連なりが一見すると何をしているのかが分かりにくいですが、
108108これは下記のように展開することができます。
109109
110110``` js
111111const middleware = (store ) => {
112- return (next ) => {
113- return (action ) => {
114- // Middlewareの処理
115- }
116- }
117- }
112+ return (next ) => {
113+ return (action ) => {
114+ // Middlewareの処理
115+ };
116+ };
117+ };
118118```
119119
120120ただ単に関数を返す関数(高階関数)を作っているだけだと分かります。
@@ -126,7 +126,6 @@ const middleware = (store) => {
126126この場合の ` next ` は ` dispatch ` と言い換えても問題ありませんが、複数の _ Middleware_ を適応した場合は、
127127** 次の** _ Middleware_ を呼び出すという事を表現しています。
128128
129-
130129## どういう仕組み?
131130
132131- 高階関数をapplyしている
You can’t perform that action at this time.
0 commit comments