chayns-components
Version:
A set of beautiful React components for developing chayns® applications.
31 lines (30 loc) • 693 B
JavaScript
export const initialState = {
data: [],
showWaitCursor: false,
isLoading: false
};
export const reducer = function (state, action) {
if (state === void 0) {
state = initialState;
}
switch (action.type) {
case 'REQUEST_DATA':
return {
...state,
data: action.clear ? [] : state.data,
showWaitCursor: !!action.showWaitCursor,
isLoading: true
};
case 'RECEIVE_DATA':
return {
...state,
data: [...state.data, ...action.data],
showWaitCursor: false,
isLoading: false,
hasMore: action.hasMore
};
default:
return state;
}
};
//# sourceMappingURL=UacGroupReducer.js.map