function messages(state = {}, action) {
  switch (action.type) {
    case actionTypes.GET_CONVERSATIONS_PENDING:
    case actionTypes.GET_MESSAGES_PENDING:
      return {
        ...state,
        isLoading: true
      }
    case actionTypes.GET_CONVERSATIONS_FULFILLED:
      const conversations = getConversations(action.payload.results)
      return {
        ...state,
        isLoading: false,
        conversations
      }
    case actionTypes.GET_MESSAGES_FULFILLED:
      return {
        ...state,
        isLoading: false,
        messages: action.payload.results
      }
    default:
      return state
  }
}
/**
 * Groups all messages to and from a given user.
 *
 * @param {object} state - the feed data. If not supplied it defaults to null
 * @param {object} action - the received action
 * @return {object} state - the new mutated state
 */
Groups all messages to and from a given user.
@param {object} state - the feed data. If not supplied it defaults to null
@param {object} action - the received action
@return {object} state - the new mutated state
Groups all messages to and from a given user . @param { object } state - the feed data . If not supplied it defaults to null @param { object } action - the received action @return { object } state - the new mutated state
function messages(state = {}, action) {
  switch (action.type) {
    case actionTypes.GET_CONVERSATIONS_PENDING:
    case actionTypes.GET_MESSAGES_PENDING:
      return {
        ...state,
        isLoading: true
      }
    case actionTypes.GET_CONVERSATIONS_FULFILLED:
      const conversations = getConversations(action.payload.results)
      return {
        ...state,
        isLoading: false,
        conversations
      }
    case actionTypes.GET_MESSAGES_FULFILLED:
      return {
        ...state,
        isLoading: false,
        messages: action.payload.results
      }
    default:
      return state
  }
}
function messages ( state = { } , action ) { switch ( action . type ) { case actionTypes . GET_CONVERSATIONS_PENDING : case actionTypes . GET_MESSAGES_PENDING : return { ... state , isLoading : true } case actionTypes . GET_CONVERSATIONS_FULFILLED : const conversations = getConversations ( action . payload . results ) return { ... state , isLoading : false , conversations } case actionTypes . GET_MESSAGES_FULFILLED : return { ... state , isLoading : false , messages : action . payload . results } default : return state } }
Groups all messages to and from a given user.
Groups all messages to and from a given user .