yarn swr 1.1.1

latest releases: 2.2.6-beta.4, 2.2.6-beta.3, 2.2.6-beta.1...
2 years ago

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: 1.1.0...1.1.1

Don't miss a new swr release

NewReleases is sending notifications on new releases.