Skip to content

Commit 52c2084

Browse files
committed
fix spacing
1 parent a2bba79 commit 52c2084

File tree

1 file changed

+16
-17
lines changed
  • src/pages/[platform]/build-a-backend/storage/list-files

1 file changed

+16
-17
lines changed

src/pages/[platform]/build-a-backend/storage/list-files/index.mdx

+16-17
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,23 @@ If the `pageSize` is set lower than the total file size, a single `list` call on
6767
import { list } from 'aws-amplify/storage';
6868
6969
const PAGE_SIZE = 20;
70-
let nextToken = undefined;
71-
//...
70+
let nextToken;
71+
// ...
7272
const loadNextPage = async () => {
73-
let response = await list({
74-
path: 'photos/',
75-
// Alternatively, path: ({ identityId }) => `album/{identityId}/photos/`
76-
options: {
77-
pageSize: PAGE_SIZE,
78-
nextToken: nextToken
79-
}
80-
}
81-
});
82-
if (response.nextToken) {
83-
nextToken = response.nextToken;
84-
} else {
85-
nextToken = undefined;
86-
}
87-
// render list items from response.items
73+
const response = await list({
74+
path: 'photos/',
75+
// Alternatively, path: ({ identityId }) => `album/{identityId}/photos/`
76+
options: {
77+
pageSize: PAGE_SIZE,
78+
nextToken,
79+
},
80+
});
81+
if (response.nextToken) {
82+
nextToken = response.nextToken;
83+
} else {
84+
nextToken = undefined;
85+
}
86+
// render list items from response.items
8887
};
8988
```
9089

0 commit comments

Comments
 (0)