Rocket.Chat.ReactNative/app/reducers/rooms.js

30 lines
566 B
JavaScript
Raw Normal View History

2017-08-17 02:06:22 +00:00
import * as types from '../actions/actionsTypes';
const initialState = {
isFetching: false,
failure: false
};
export default function login(state = initialState, action) {
switch (action.type) {
case types.ROOMS.REQUEST:
return { ...state,
isFetching: true
};
case types.ROOMS.SUCCESS:
return { ...state,
isFetching: false
};
2017-08-17 06:28:41 +00:00
case types.ROOMS.FAILURE:
2017-08-17 02:06:22 +00:00
return { ...state,
isFetching: false,
failure: true,
errorMessage: action.err
};
// case types.LOGOUT:
// return initialState;
default:
return state;
}
}