Skip to content

v3.5.6

Compare
Choose a tag to compare
@danybeltran danybeltran released this 29 Jun 19:47
· 41 commits to master since this release
9073a5e

Features

attempts can now be a function

Example usage (retry 4 times):

const { data } = useFetch("/api/data", {
  attempts({ status, res }) {
    if (status === 404) return // Don't retry 404s

    console.log("Failed to fetch ", res.url)
    return 4
  },
  attemptInterval: "2 sec",
})

You can always use a number as attempts