UNPKG

loop-modules

Version:

Shared modules for the Loop product suite.

18 lines (17 loc) 608 B
import { initialState } from '../states/loop-activity-message.state'; import { ActionTypes } from '../actions/loop-activity-message.action'; export function reducer(state, action) { if (state === void 0) { state = initialState; } switch (action.type) { case ActionTypes.QUERY: return Object.assign({}, state, { entries: state.entries.concat(action.payload) }); case ActionTypes.SET_ENTRIES: return Object.assign({}, state, { entries: action.payload }); default: return state; } }