async function requestChanges(xhr, calendarToUpdate) {
  const eventsToUpdate = [];
  let result;
  do {
    const req = this.dav.request.syncCollection({
      syncLevel: 1,
      syncToken: result ? result.syncToken : calendarToUpdate.sync_token || '',
      props: [{ name: 'getetag', namespace: this.dav.ns.DAV }],
    });
    // eslint-disable-next-line no-await-in-loop
    result = await xhr.send(req, calendarToUpdate.external_id);
    eventsToUpdate.push(...result.responses.filter((event) => event.href));
  } while (result.responses.length > 0);

  return eventsToUpdate;
}
@description Get events that have changed from caldav server.
@param {object} xhr - Request with dav credentials.
@param {object} calendarToUpdate - Calendar that needs updating.
@returns {Promise} Resolving with list of events to update.
@example
requestChanges(xhr, calendarToUpdate)