Sha256: f7b2ad5427df2370cc274b1c309c94adc2c933666e49b5bb67fbc0bcfa8fe23b
Contents?: true
Size: 743 Bytes
Versions: 11
Compression:
Stored size: 743 Bytes
Contents
import Immutable from 'seamless-immutable'; import { deepPropsToCamelCase } from 'foremanReact/common/helpers'; import { TEMPLATESYNC_FORM_SUBMITTED, SYNC_RESULT_PAGINATION_CHANGE, } from '../../consts'; export const initialState = Immutable({ resultAction: '', templates: [], pagination: { page: 1, per_page: 20, }, }); const syncResult = (state = initialState, action) => { const { payload } = action; switch (action.type) { case TEMPLATESYNC_FORM_SUBMITTED: return state.merge({ ...deepPropsToCamelCase(payload.data), }); case SYNC_RESULT_PAGINATION_CHANGE: return state.set('pagination', payload.pagination); default: return state; } }; export default syncResult;
Version data entries
11 entries across 11 versions & 1 rubygems