Browse Source

Merge pull request #2240 from christianalfoni/patch-1

Update flux-todo-list.md
main
Bill Fisher 10 years ago
parent
commit
e396d0ab10
  1. 20
      docs/flux-todo-list.md

20
docs/flux-todo-list.md

@ -147,23 +147,19 @@ Now we are all set to create a dispatcher that is more specific to our app, whic
```javascript
var Dispatcher = require('./Dispatcher');
var merge = require('react/lib/merge');
var AppDispatcher = merge(Dispatcher.prototype, {
var AppDispatcher = new Dispatcher();
/**
/**
* A bridge function between the views and the dispatcher, marking the action
* as a view action. Another variant here could be handleServerAction.
* @param {object} action The data coming from the view.
*/
handleViewAction: function(action) {
this.dispatch({
source: 'VIEW_ACTION',
action: action
});
}
});
AppDispatcher.handleViewAction = function(action) {
this.dispatch({
source: 'VIEW_ACTION',
action: action
});
};
module.exports = AppDispatcher;
```

Loading…
Cancel
Save