Skip to content

1.1.1

Compare
Choose a tag to compare
@shuding shuding released this 10 Dec 16:06
b78937f

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