UNPKG

chayns-components

Version:

A set of beautiful React components for developing chayns® applications.

37 lines (35 loc) 834 B
"use strict"; exports.__esModule = true; exports.reducer = exports.initialState = void 0; const initialState = { data: [], showWaitCursor: false, isLoading: false }; exports.initialState = initialState; 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; } }; exports.reducer = reducer; //# sourceMappingURL=UacGroupReducer.js.map