Skip to main content

PollingSubscription

Will dispatch a fetch action at the minimum interval of all subscriptions to this resource.

  • Pauses when offline.
  • Immediately fetches when online status returns.
  • Immediately fetches any new subscriptions.
implements

PollingSubscription implements Subscription

import {
SubscriptionManager,
PollingSubscription,
CacheProvider,
NetworkManager,
} from '@data-client/react';
import ReactDOM from 'react-dom';

const managers = [
new NetworkManager(),
new SubscriptionManager(PollingSubscription)
]

ReactDOM.render(
<CacheProvider managers={managers}>
<App />
</CacheProvider>,
document.body,
);

Dispatched Actions

  • 'rdc/fetch'

Note:

This is already used by CacheProvider by default.