function listenersById(state = {}, { type, path, payload }) {
  switch (type) {
    case SET_LISTENER:
      return {
        ...state,
        [payload.id]: {
          id: payload.id,
          path
        }
      }
    case UNSET_LISTENER:
      return omit(state, [payload.id])
    default:
      return state
  }
}
Reducer for listeners ids. Changed by `SET_LISTENER` and `UNSET_LISTENER`
actions.
@param {object} [state={}] - Current listenersById 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} listenersById state after reduction (used in listeners)
@private