Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fetchWitchTimeout({ timeout, ...fetchOptions }) {
- return Promise.race([
- fetch(...fetchOptions),
- new Promise((_, reject) =>
- setTimeout(() => {
- reject(Error('Timedout'))
- }, timeout)
- )
- I
- ¥
Advertisement
Add Comment
Please, Sign In to add comment