UNPKG

admin-on-rest-fr05t1k

Version:

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

22 lines (19 loc) 482 B
import { CRUD_CHANGE_LIST_PARAMS } from '../../../actions/listActions'; const defaultState = { sort: null, order: null, page: 1, perPage: null, filter: {}, }; export default resource => (previousState = defaultState, { type, payload, meta }) => { if (!meta || meta.resource !== resource) { return previousState; } switch (type) { case CRUD_CHANGE_LIST_PARAMS: return payload; default: return previousState; } };