Sha256: 2cea085f7086b00c3897d8444f9545e58a6b5c336759e9dd144ee653d72e8cc0
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
import Immutable from 'seamless-immutable'; import { combineReducers } from 'redux'; import { createTableReducer } from 'foremanReact/components/common/table'; import createTableActionTypes from 'foremanReact/components/common/table/actionsHelpers/actionTypeCreator'; import { TASKS_TABLE_ID } from './TasksTableConstants'; export const TasksTableQueryReducer = (state = {}, action) => { const { type, payload: { subtotal, page, per_page: perPageString, action_name: actionName, } = {}, } = action; const ACTION_TYPES = createTableActionTypes(TASKS_TABLE_ID); switch (type) { case ACTION_TYPES.SUCCESS: return Immutable.merge(state, { itemCount: subtotal, actionName, pagination: { page: Number(page), perPage: Number(perPageString), }, }); default: return state; } }; export default combineReducers({ tasksTableContent: createTableReducer(TASKS_TABLE_ID), tasksTableQuery: TasksTableQueryReducer, });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
foreman-tasks-0.17.1 | webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js |