releases.shpreview
Vercel/SWR/1.1.1

1.1.1

December 10, 2021SWRView original ↗
$npx -y @buildinternet/releases show rel_mFUDlaBXtnk9aX96tgZbj

Highlights of This Release

Dynamic refreshInterval

You can now pass a function as refreshInterval, to dynamically return the interval (in millisecond) til the next request, based on the current data:

useSWR('key', fetcher, {
  refreshInterval: function (data: Data | undefined) {
    if (!data) return 3000 // Initial request 
    return data.next_update
  }
})

If return 0, polling will be stopped.

What's Changed

New Contributors

Full Changelog: https://github.com/vercel/swr/compare/1.1.0...1.1.1

Fetched April 18, 2026