Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can imagine that a key command, a click on a button, or even a command originated from a remote control that arrives proxied over a WebSocket - all of these could create the same Action. Each Store shouldn't care, or have any interest in, what component created that Action. And you should be able to add new Stores and new interaction types at runtime, as if (in music production) you were plugging in a plug-and-play MIDI keyboard and simultaneously adding a new audio plugin that reacts to any MIDI input. The Dispatcher removes any dependencies between these components; everything just needs to know about the Dispatcher.


Just trying to understand here:

What's the practical difference between the dependency on knowing the right action to call to the dispatcher vs. the dependency on calling the Singleton Store method?


I haven't used flux yet, but I'm assuming a single action might call on multiple stores? Eliminates having to handle that in a dependency


But even that action will have to manage the dependencies on these multiple stores, doesn't it? Whether it's called an Action or associated with a Store, does it make a practical difference?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: