UNPKG

addsearch-search-ui

Version:

JavaScript library to develop Search UIs for the web

23 lines (18 loc) 468 B
import { CLEAR_FIELD_STATS, SET_FIELD_STATS } from "../actions/fieldstats"; const initialState = { fieldStats: {} }; export default function fieldstats(state = initialState, action) { switch (action.type) { case SET_FIELD_STATS: return Object.assign({}, state, { fieldStats: action.fieldStats }); case CLEAR_FIELD_STATS: return Object.assign({}, state, { fieldStats: {} }); default: return state } }