utils#retryWrapper TypeScript Examples
The following examples show how to use
utils#retryWrapper.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: utils.ts From exevo-pan with The Unlicense | 7 votes |
fetchItemPage = retryWrapper(
async (itemName: string, index: number): Promise<RareItemBlock> => {
const url = buildItemPageUrl(itemName, index)
const helper = new AuctionList()
const html = await HttpClient.getHtml(url)
const lastPageIndex = helper.lastPageIndex(html)
const ids = helper.auctionBlocks(html).map(({ id }) => id)
return { name: itemName, lastPageIndex, ids }
},
)
Example #2
Source File: utils.ts From exevo-pan with The Unlicense | 6 votes |
getPostData = retryWrapper((args: PostHtmlProps) => {
logRequest(args)
return HttpClient.postHtml(args)
})
Example #3
Source File: fetchHighestAuctionId.ts From exevo-pan with The Unlicense | 6 votes |
fetchHighestAuctionId = retryWrapper(async (): Promise<number> => {
broadcast('Scraping new highest auction id...', 'neutral')
const helper = new AuctionList()
const html = await HttpClient.getHtml(SORTED_NEWEST_HISTORY_URL)
const auctionBlocks = helper.auctionBlocks(html)
return Math.max(...auctionBlocks.map(({ id }) => id))
})
Example #4
Source File: utils.ts From exevo-pan with The Unlicense | 6 votes |
fetchAuctionPage = retryWrapper(async (auctionId: number) =>
HttpClient.getHtml(`${AUCTION_PAGE_URL}&auctionid=${auctionId}`),
)
Example #5
Source File: utils.ts From exevo-pan with The Unlicense | 6 votes |
fetchAuctionPage = retryWrapper(async (auctionId: number) =>
HttpClient.getHtml(`${AUCTION_PAGE_URL}&auctionid=${auctionId}`),
)
Example #6
Source File: utils.ts From exevo-pan with The Unlicense | 6 votes |
fetchServerPage = retryWrapper(() =>
HttpClient.getHtml(SERVER_LIST_URL),
)
Example #7
Source File: fetchAuctionPageIndexes.ts From exevo-pan with The Unlicense | 6 votes |
fetchAuctionPageIndexes = retryWrapper(
async (): Promise<number[]> => {
broadcast('Fetching for all auction pages indexes...', 'neutral')
const helper = new AuctionList()
const html = await HttpClient.getHtml(FIRST_PAGE_AUCTION_LIST)
const lastPageIndex = helper.lastPageIndex(html)
return Array.from({ length: lastPageIndex }, (_, index) => index + 1)
},
)
Example #8
Source File: fetchHighlightedAuctionData.ts From exevo-pan with The Unlicense | 5 votes |
fetchData = retryWrapper(async () =>
HttpClient.getJSON<RawHighlightedData[]>(`${DATA_ENDPOINT}/api`),
)
Example #9
Source File: index.ts From exevo-pan with The Unlicense | 5 votes |
dispatchRevalidate = retryWrapper(RevalidateClient.route)
Example #10
Source File: fetchAuctionsFromPage.ts From exevo-pan with The Unlicense | 5 votes |
fetchAuctionsFromPage = retryWrapper(async (pageIndex) => {
const helper = new AuctionList()
const html = await HttpClient.getHtml(
`${AUCTION_LIST_URL}/?currentpage=${pageIndex}`,
)
return helper.auctionBlocks(html)
})
Example #11
Source File: fetchNewAuctions.ts From exevo-pan with The Unlicense | 5 votes |
fetchAuctionPage = retryWrapper(async (auctionId: number) =>
HttpClient.getHtml(`${AUCTION_PAGE_URL}&auctionid=${auctionId}`),
)