Created
June 14, 2019 23:16
-
-
Save zackshapiro/3f4940f7414290be8bd23dd7f6df1b25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reducer = (state, action) => { | |
switch (action.type) { | |
case 'load': | |
return { ...state, files: action.files, status: LOADED } | |
case 'submit': | |
return { ...state, uploading: true, pending: state.files, status: INIT } | |
case 'next': | |
return { | |
...state, | |
next: action.next, | |
status: PENDING, | |
} | |
default: | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment