News for hackers. Stuff that matters.
Re:A simpler web architecture using React, Flux, CSP, and FR... by danielmason on Saturday August 15, 2015 @11:19AM (#10065597)
Doesn't the OO approach just move the work of the switch statement into the class declaration of the model? In practice, OO is about encapsulation, and FP is not. So it's probably not too surprising that the author chose not mix metaphors.

This is also modeled after an architecture in a statically typed language that expresses possible actions as a single union type, in which every possible type must be handled. There's no similar compile-time guarantee in JS, but a switch statements with constants is a reasonable approximation of the idea.

There are no comments on this comment yet.