mahaplatform/reframe

View on GitHub
src/components/search2/reducer.js

Summary

Maintainability
A
0 mins
Test Coverage
const INITIAL_STATE = {
  q: ''
}

const query = (state, action) => ({
  ...state,
  q: action.q
})

const reducer = (state = INITIAL_STATE, action) => {

  switch (action.type) {

  case 'QUERY':
    return query(state, action)

  default:
    return state
  }

}

export default reducer