Hard
You're building a paginated data fetcher that needs to work with for-await-of loops. What's the correct implementation of the missing methods to make this code work?
1class PaginatedFetcher {2 constructor(baseUrl, itemsPerPage = 10) {3 this.baseUrl = baseUrl;4 this.itemsPerPage = itemsPerPage;5 this.currentPage = 0;6 this.hasMore = true;7 }89 // Missing implementation10 ____________________11 ____________________12 ____________________13 ____________________14}1516// Usage:17async function fetchAllUsers() {18 const fetcher = new PaginatedFetcher('/api/users', 25);19 const users = [];2021 for await (const page of fetcher) {22 users.push(...page);23 }2425 return users;26}