Skip to content

Commit

Permalink
refactor: destructure url instead of accessing whole object and acces…
Browse files Browse the repository at this point in the history
…sing url
  • Loading branch information
bijayrauniyar0 committed Nov 27, 2024
1 parent 275bc97 commit 84aaee3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const ImageMapBox = () => {
);

// urls fromm array of objects is retrieved and stored in value
const urls = urlsData.data.map((url: any) => url.url);
const urls = urlsData.data.map(({ url }: { url: string }) => url);
const chunkedUrls = chunkArray(urls, 4);
const chunkedFiles = chunkArray(files, 4);

Expand All @@ -167,7 +167,7 @@ const ImageMapBox = () => {
const width = widthCalulator(uploadedFilesNumber.current, files.length);
setLoadingWidth(width);

// to call api in chunks of 4 with a delay of 2 seconds
// to call api in chunks of 4 with a delay of 500ms
if (index < chunkedUrls.length - 1) {
await delay(500);
}
Expand Down

0 comments on commit 84aaee3

Please sign in to comment.