Skip to content

Commit 2061840

Browse files
authored
fix(storage): add options object to list example (#8184)
* add options * fix spacing * spaces instead of tabs
1 parent 6ab9f19 commit 2061840

File tree

1 file changed

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

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ 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({
73+
const response = await list({
7474
path: 'photos/',
7575
// Alternatively, path: ({ identityId }) => `album/{identityId}/photos/`
76-
pageSize: PAGE_SIZE,
77-
nextToken: nextToken
78-
}
76+
options: {
77+
pageSize: PAGE_SIZE,
78+
nextToken,
79+
},
7980
});
8081
if (response.nextToken) {
8182
nextToken = response.nextToken;

0 commit comments

Comments
 (0)