function updateTerm(term) {
  if (term === '') return reset()

  return (dispatch) => {
    dispatch({
      type: UPDATE_TERM,
      payload: term,
    })
    eachPlugin(term, (plugin, payload) => {
      let result = Array.isArray(payload) ? payload : [payload]
      result = result.map((x) => ({
        ...x,
        plugin,
        // Scope result ids with plugin name and use title if id is empty
        id: `${plugin}-${x.id || x.title}`
      }))
      if (result.length === 0) {
        // Do not dispatch for empty results
        return
      }
      dispatch(onResultFound(term, result))
    })
  }
}
Action that updates search term

@param  {String} term
@return {Object}  redux action