阿黎2019-11-27 11:31:13 0 0 529
[React讨论组]源自课程章节:Reducer介绍举报回复话题 ↕
import {Dispatcher} from 'flux';//引用storeimport Store from '../stores/TodoStore';const TodoDispatcher=new Dispatcher();TodoDispatcher.regeist(function(action){ switch (action.actionType) { case "ADD_TODO": Store.addTodoData(action.payload); Store.emitChange(); //调用store break; default: //其他处理 break; }})export default TodoDispatcher;