Sha256: 52310e25e36ae4cb83cfb06fbd0b5b782cc74e799b0b88fa1fd6deeed8244528
Contents?: true
Size: 523 Bytes
Versions: 6
Compression:
Stored size: 523 Bytes
Contents
import Immutable from 'seamless-immutable'; import { INSIGHTS_HITS_SUCCESS, INSIGHTS_HITS_FAILURE, } from './InsightsTabConstants'; const initialState = Immutable({ hits: [], }); export default (state = initialState, action) => { const { payload: { hits, error } = {} } = action; switch (action.type) { case INSIGHTS_HITS_SUCCESS: return state.merge({ hits, }); case INSIGHTS_HITS_FAILURE: return state.merge({ error, }); default: return state; } };
Version data entries
6 entries across 6 versions & 1 rubygems