Skip to content

Instantly share code, notes, and snippets.

@mbrown3321
Created November 1, 2020 22:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mbrown3321/cf696c79b85548ec0ebae43109c2baf1 to your computer and use it in GitHub Desktop.
import {FETCH_UPLOADS_COMMIT, FETCH_UPLOADS, ADD_UPLOAD} from '../actions';
export default function uploads(state = [], action) {
switch (action.type) {
case FETCH_UPLOADS:
return state;
case FETCH_UPLOADS_COMMIT:
return [...action.payload];
case ADD_UPLOAD:
return [...state, action.payload];
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment