RefreshOnWindowFocus
By setting options.refreshOnWindowFocus
, the request will be refreshed when the browser is refocus
and revisible
.
Code demonstration
API
Options
Property | Description | Type | Default |
---|---|---|---|
refreshOnWindowFocus | Whether to re-initiate the request when the screen refocus or revisible. | boolean |Ref<boolean> | false |
focusTimespan | Re-request interval, in milliseconds | number | Ref<number> | 5000 |
Remark
options.refreshOnWindowFocus
support dynamic changes.options.focusTimespan
support dynamic changes.- Listen for browser events
visibilitychange
andfocus
.