Skip to content

Commit

Permalink
fix(storage): add options object to list example (#8184)
Browse files Browse the repository at this point in the history
* add options

* fix spacing

* spaces instead of tabs
  • Loading branch information
jjarvisp authored Jan 7, 2025
1 parent 6ab9f19 commit 2061840
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ 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({
const response = await list({
path: 'photos/',
// Alternatively, path: ({ identityId }) => `album/{identityId}/photos/`
pageSize: PAGE_SIZE,
nextToken: nextToken
}
options: {
pageSize: PAGE_SIZE,
nextToken,
},
});
if (response.nextToken) {
nextToken = response.nextToken;
Expand Down

0 comments on commit 2061840

Please sign in to comment.