|
|
|
|
|
by Retozi
3963 days ago
|
|
I think this is a bad idea. First with methods, you have mutable state, which I believe should be avoided. It causes a lot of problems for efficient rendering. You could make some kind of wrapper, but I guess it's not worth the hassle to save a couple of characters. Second, Action can cause complex writes that touch more than one model (or if you have one global model, multiple state slices). You probably want to have the write functions named independently, so they can be reused over multiple actions if necessary. |
|
Both are functions that operate on the same data; the OO syntax is just a convenience that was invented exactly for the reason of avoiding endless switch statements in dispatching actions on a particular piece of data.