June 2016
Intermediate to advanced
910 pages
18h 59m
English
Now let's implement this data flow. We'll start by creating a dispatcher first. Facebook offers us its implementation of a dispatcher that we can reuse. Let's take advantage of this.
~/snapterest directory and run the following command:
npm install --save flux
The flux module comes with a Dispatcher function that we'll be reusing.
dispatcher in our project's ~/snapterest/source/dispatcher directory. Now create the AppDispatcher.js file in it:var Dispatcher = require('flux').Dispatcher;
module.exports = new Dispatcher();First, we import Dispatcher provided by Facebook, then create, and export a new instance of it. Now we can use this instance in our application.
Next, we need a ...
Read now
Unlock full access