function allListeners(state = [], { type, path, payload }) {
  switch (type) {
    case SET_LISTENER:
      return [...state, payload.id]
    case UNSET_LISTENER:
      return state.filter((lId) => lId !== payload.id)
    default:
      return state
  }
}
Reducer for listeners state. Changed by `UNAUTHORIZED_ERROR`
and `LOGOUT` actions.
@param {object} [state=[]] - Current allListeners redux state
@param {object} action - Object containing the action that was dispatched
@param {string} action.type - Type of action that was dispatched
@param {string} action.path - Path of action that was dispatched
@param {object} action.payload - Payload object
@returns {object} allListeners state after reduction (used in listeners)
@private