# All files / src/reducers users.js

83.33% Statements 5/6
80% Branches 4/5
100% Functions 1/1
83.33% Lines 5/6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    4x

    4x
    1x

    3x

    3x

     import { CREATE_USER_SUCCESS, FETCH_USER_SUCCESS } from '../actionTypes'

    export default function usersReducer (state = [], action) {
      const { type } = action

      if (type === FETCH_USER_SUCCESS) {
        return [ ...state, action.result ]
      }

      Iif (type === CREATE_USER_SUCCESS) {
        return [ ...state, action.result ]
      }

      return state
    }