UNPKG

admin-on-rest-fr05t1k

Version:

A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI

15 lines (13 loc) 384 B
import { FETCH_START, FETCH_END, FETCH_ERROR, FETCH_CANCEL } from '../actions/fetchActions'; export default (previousState = 0, { type }) => { switch (type) { case FETCH_START: return previousState + 1; case FETCH_END: case FETCH_ERROR: case FETCH_CANCEL: return Math.max(previousState - 1, 0); default: return previousState; } };