Skip to content

Instantly share code, notes, and snippets.

@Djuki
Last active February 29, 2020 11:12
Show Gist options
  • Save Djuki/af8140ab21f3bef0e300deaf73c31fff to your computer and use it in GitHub Desktop.
Save Djuki/af8140ab21f3bef0e300deaf73c31fff to your computer and use it in GitHub Desktop.
import React from 'react';
import { SUCCESS_FETCH_BRANCHES } from '../actions';
const repositories = (state = {}, action = []) => {
switch (action.type) {
case SUCCESS_FETCH_BRANCHES: {
return { ...state, branches: state.branches.concat(action.branches), branchesNextPage: action.nextPage };
}
default: {
return state;
}
}
return state;
};
export default repositories;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment