React Reducer

PHOTO EMBED

Wed Sep 28 2022 06:00:28 GMT+0000 (UTC)

Saved by @Jeremicah #react.js

const counterReducer = (count, action) => {
  switch (action.type) {
    case 'INCREASE':
      return count + 1;
    case 'DECREASE':
      return count - 1;
    default:
      return count;
  }
};
content_copyCOPY