From 8e37299a41d891b05862e42e94fd89dc221460f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= <40865952+tamasmlnr@users.noreply.github.com> Date: Mon, 3 Feb 2020 14:26:30 +0100 Subject: [PATCH] Add missing code to reducer.js The course mentions the contents of the file, but it's empty in the repo. --- src/reducer.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/reducer.js b/src/reducer.js index e69de29..e9a1861 100644 --- a/src/reducer.js +++ b/src/reducer.js @@ -0,0 +1,22 @@ +const initialState = { + good: 0, + ok: 0, + bad: 0 +} + +const counterReducer = (state = initialState, action) => { + console.log(action) + switch (action.type) { + case 'GOOD': + return state + case 'OK': + return state + case 'BAD': + return state + case 'ZERO': + return state + } + return state +} + +export default counterReducer