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 ```javascript
var Dispatcher = require('./Dispatcher'); var Dispatcher = require('./Dispatcher');
var merge = require('react/lib/merge'); var AppDispatcher = new Dispatcher();
var AppDispatcher = merge(Dispatcher.prototype, {
/** /**
* A bridge function between the views and the dispatcher, marking the action * A bridge function between the views and the dispatcher, marking the action
* as a view action. Another variant here could be handleServerAction. * as a view action. Another variant here could be handleServerAction.
* @param {object} action The data coming from the view. * @param {object} action The data coming from the view.
*/ */
handleViewAction: function(action) { AppDispatcher.handleViewAction = function(action) {
this.dispatch({ this.dispatch({
source: 'VIEW_ACTION', source: 'VIEW_ACTION',
action: action action: action
}); });
} };
});
module.exports = AppDispatcher; module.exports = AppDispatcher;
``` ```

Loading…
Cancel
Save