admin-on-rest-fr05t1k
Version:
A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI
12 lines (10 loc) • 338 B
JavaScript
import { CRUD_GET_LIST_SUCCESS } from '../../../actions/dataActions';
export default resource => (previousState = 0, { type, payload, meta }) => {
if (!meta || meta.resource !== resource) {
return previousState;
}
if (type === CRUD_GET_LIST_SUCCESS) {
return payload.total;
}
return previousState;
};