Optional
It tries to call the given function "func" with the given options.
The returned value is analogous to the error handling mechanism in the Golang.
const [error, result] = await retryAsync( () => fetch('https://example.com/data'), { retry: 3, delay: 1000, });if (error) { throw error;}console.log(result); Copy
const [error, result] = await retryAsync( () => fetch('https://example.com/data'), { retry: 3, delay: 1000, });if (error) { throw error;}console.log(result);
Description
It tries to call the given function "func" with the given options.
The returned value is analogous to the error handling mechanism in the Golang.
Example