|
|
|
|
|
by zzzzzzzza
3030 days ago
|
|
I missed the part where you explained why changing the reducer to an object with methods would bring any benefits, or what's bad about message passing (it seems to me off the top of my head that changing this would at the very least, break redux observable as it currently works) |
|
Because this is how the rest of your programming works, you call functions. In Node you don't have `fs.processMessage('readFile', {path, next})` because `fs.readFile(path, next)` is simpler. Message passing is nice if you pass process boundaries or can't know about the function definition but in Redux you pull in the string constants and everything anyway. Message passing also lets you hook several handlers (reducers) to the same message but I have yet to see it significantly used, this is a niche case.