Skip to content

Instantly share code, notes, and snippets.

@ankitghike
Created October 4, 2018 08:07
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ankitghike/e7f4d2c58cefbea1edc3318cb083d49c to your computer and use it in GitHub Desktop.
const INITIAL_STATE = {
friends: [],
friendsFetched: false
};
function(state = INITIAL_STATE, action) {
switch(action.type) {
case 'FRIENDS_FETCHED':
return {
...state,
friends: action.payload,
friendsFetched: true
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment