Skip to content

Commit 20dce41

Browse files
authored
Merge pull request #226 from kravetsone/kravetsone-avoid-useless-promise-all
avoid useless Promise.all at smart calendar sync example
2 parents 5d48ef6 + 32fd7a4 commit 20dce41

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Diff for: docs/docs/caldav/createCalendarObject.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ create one calendar object on the target calendar
99
```ts
1010
const result = await createCalendarObject({
1111
calendar: calendars[0],
12-
filename: 'test.ics'
12+
filename: 'test.ics',
1313
iCalString: 'BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//ZContent.net//Zap Calendar 1.0//EN\nBEGIN:VEVENT\nCALSCALE:GREGORIAN\nMETHOD:PUBLISH\nSUMMARY:Abraham Lincoln\nUID:c7614cff-3549-4a00-9152-d25cc1fe077d\nSEQUENCE:0\nSTATUS:CONFIRMED\nTRANSP:TRANSPARENT\nRRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=2;BYMONTHDAY=12\nDTSTART:20080212T182145Z\nDTEND:20080213T182145Z\nDTSTAMP:20150421T182145Z\nCATEGORIES:U.S. Presidents,Civil War People\nLOCATION:Hodgenville, Kentucky\nGEO:37.5739497;-85.7399606\nDESCRIPTION:Born February 12, 1809 Sixteenth President (1861-1865) http\://AmericanHistoryCalendar.com\nURL:http\://americanhistorycalendar.com/peoplecalendar/1,328-abraham-lincoln\nEND:VEVENT\nEND:VCALENDAR',
1414
headers: {
1515
authorization: 'Basic x0C9ueWd9Vz8OwS0DEAtkAlj',

Diff for: docs/docs/smart calendar sync.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,12 @@ you can use `syncCalendars` function from the lib with `detailedResult` set as `
131131

132132
```ts
133133
const { created, updated, deleted } = await client.syncCalendars({
134-
oldCalendars: await Promise.all(
135-
localCalendars.map(async (lc) => ({
134+
oldCalendars: localCalendars.map((lc) => ({
136135
displayName: lc.name,
137136
syncToken: lc.syncToken,
138137
ctag: lc.ctag,
139138
url: lc.url,
140-
}))
139+
})
141140
),
142141
detailedResult: true,
143142
});

0 commit comments

Comments
 (0)