In this lesson we'll create a very simple application dispatcher utilizing the open source flux dispatcher from Facebook.
Joe... When creating the facade for Flux’s Dispatcher, your parameter list for “dispatch” (actionType, action) does not match the Flux implementation (payload). This single “payload” parameter is an object which has an “actionType” property. In the next lesson you will correctly call the dispatch façade with a single argument of “{actionType, item}”.
Thanks for the feedback, Stephen. Good catch, I'll see about updating that description.
How does the Events dependency get added to react projects?
If i was building a node application and running with node index.js
, I know it's apart of the node-core; however when we're building these react flux apps and extending the event emitter, I don't quite understand where that dependency comes from?
We aren't doing npm install events anywhere, it just seems to magically be there. Could you please shed some light on this?
Thank you!
Node comes with a bunch of libraries, events being one of them. Since node is installed on your system and used by webpack when compiling your code it will be available and bundled in your app. You can do that with every package that comes with node.