From ec18cb398b619926169a6e67a38ef4ba400431cd Mon Sep 17 00:00:00 2001 From: Isabelle Viktoria Maciohsek Date: Fri, 19 Aug 2022 11:03:23 +0300 Subject: [PATCH] Update react-redux-readable-reducers.md --- blog_posts/react-redux-readable-reducers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog_posts/react-redux-readable-reducers.md b/blog_posts/react-redux-readable-reducers.md index 29a45ae98..12d12f900 100644 --- a/blog_posts/react-redux-readable-reducers.md +++ b/blog_posts/react-redux-readable-reducers.md @@ -64,7 +64,7 @@ const reducer = (state = initialState, action) => { While the code in the example is not that complicated right now, complexity can increase very fast as more action types need to be handled by our application. This is due to the fact that each `action.type`'s logic is nested inside the `reducer` function, thus adding more code and complexity with each new action. -Another issue we can identify is that each `action` has a different structure, which increases congitive load for future maintainers, as they have to remember what keys their `action` needs to have. There's also the added issue of running into a case where `action.type` might be needed to pass actual data to the state (i.e. `state.type` could exist). +Another issue we can identify is that each `action` has a different structure, which increases cognitive load for future maintainers, as they have to remember what keys their `action` needs to have. There's also the added issue of running into a case where `action.type` might be needed to pass actual data to the state (i.e. `state.type` could exist). Finally, our `action.type` values are hardcoded inside the `reducer` function, making it hard to remember and sync across other files and components. This might seem like the least of our problems, but it's probably the easiest one to fix, so let's start there.