Есть два reducer'a, нужно получить один. Как это сделать?
import * as constants from '../constants';
const initialState = [];
export function queryLog(state = initialState, action): object {
if (action.type === constants.LOAD_QUERY_LOG_STOP) {
action.queryLog.forEach(e => {
if ('dt_changelog' in e) {
e['dt_changelog'] = e.dt_changelog * 1000;
}
});
return action.queryLog;
}
return state;
}
import * as constants from '../constants';
const initialState = [];
export function comments(state = initialState, action): object {
if (action.type === constants.LOAD_COMMENTS_STOP || action.type === constants.SENT_COMMENT) {
action.comments.forEach(e => {
if ('datetime' in e) {
e.datetime = e.datetime * 1000;
}
});
return action.comments;
}
return state;
}