by gecko · 11y ago · 0 comments
Have you seen Facebook's Flux/Dispatcher framework, for example? The Dispatcher is usually a massive switch statement that takes a single argument, which will be a record field that corresponds with the event type. It's exactly like switching on uMsg and then casting lParam to the relevant struct. And this is considered one of the absolute best web frameworks available right now.
On the bright side, I suppose we can look forward to equivalents of message crackers, OWL, and MFC for React soon enough.
Somehow it also says something, whatever the underlying structure, local and native VS remote and abstracted (dom/js), some patterns keeps coming back over and over.
Stores have the switch, and you're supposed to break those up along model lines. In most the apps I've written, they never get beyond 4 or 5 branches.