Skip to content

Instantly share code, notes, and snippets.

@thibaudcolas
Created May 30, 2016 14:17
Show Gist options
  • Save thibaudcolas/68bdf0aa9268041789aa4cead696c58d to your computer and use it in GitHub Desktop.
Save thibaudcolas/68bdf0aa9268041789aa4cead696c58d to your computer and use it in GitHub Desktop.
Example of Redux action types definition with keyMirror and ES6.
import keyMirror from 'keymirror';
export default keyMirror({
LOAD_DATASETS_START: null,
LOAD_DATASETS_SUCCESS: null,
LOAD_DATASETS_ERROR: null,
LOAD_DATASETS_NOT_FOUND: null,
LOAD_DATA_START: null,
LOAD_DATA_SUCCESS: null,
LOAD_DATA_ERROR: null,
LOAD_DATA_NOT_FOUND: null,
DISMISS_ERROR: null,
DISMISS_HOME_OVERLAY: null,
CHANGE_COMPARISON_TOGGLE: null,
CHANGE_COMPARISON_CONFIRM: null,
CHANGE_TIME_FILTER: null,
RESET_TIME_FILTER: null,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment