DEV Community


Discussion on: What Is a Reducer in JavaScript? A Complete Introduction with Examples

codingsafari profile image
Nico Braun

Why is this better than haven an object or class with the appropriate named functions? Why having a single function and then using a switch statement? At least this example implementation seems imperformant and error prone to me.