Skip to content

Commit

Permalink
fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
jjarvisp committed Jan 3, 2025
1 parent a2bba79 commit 52c2084
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/pages/[platform]/build-a-backend/storage/list-files/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,23 @@ If the `pageSize` is set lower than the total file size, a single `list` call on
import { list } from 'aws-amplify/storage';
const PAGE_SIZE = 20;
let nextToken = undefined;
//...
let nextToken;
// ...
const loadNextPage = async () => {
let response = await list({
path: 'photos/',
// Alternatively, path: ({ identityId }) => `album/{identityId}/photos/`
options: {
pageSize: PAGE_SIZE,
nextToken: nextToken
}
}
});
if (response.nextToken) {
nextToken = response.nextToken;
} else {
nextToken = undefined;
}
// render list items from response.items
const response = await list({
path: 'photos/',
// Alternatively, path: ({ identityId }) => `album/{identityId}/photos/`
options: {
pageSize: PAGE_SIZE,
nextToken,
},
});
if (response.nextToken) {
nextToken = response.nextToken;
} else {
nextToken = undefined;
}
// render list items from response.items
};
```

Expand Down

0 comments on commit 52c2084

Please sign in to comment.