NoteStore.__onDispatch = function(payload) { switch(payload.actionType) { case NoteConstants.SET_CURRENT_NOTE: NoteStore.switchNote(payload.note); break; case NoteConstants.NEW_NOTE: NoteStore.switchNote(payload.note); break; case NoteConstants.UPDATE_NOTE: NoteStore.updateNote(payload.note); break; case NoteConstants.DELETE_NOTE: NoteStore.deleteNote(payload.note); break; case NoteConstants.START_DRAG: NoteStore.startDrag(payload.id); break; case NoteConstants.END_DRAG: NoteStore.endDrag(); break; case NotebookConstants.RECEIVE_NEW_NOTEBOOK: NoteStore.switchBook(payload.notebook); break; case NotebookConstants.RECEIVE_EXISTING_NOTEBOOK: NoteStore.switchBook(payload.notebook); break; case NoteConstants.RECEIVE_TAGGED_NOTES: NoteStore.switchBook(payload.tagNotebook); break; case TagConstants.RECEIVE_TAG: NoteStore.addTag(payload.tag); break; case TagConstants.REMOVE_TAG: NoteStore.removeTag(payload.tag); break; } };