Change polling
Choosing when to poll for changes
const myCustomDataSource = createReplicaDataSource({
pullDeltaOnRestart: true, // Update cache each time the agent restarts.
pullDeltaOnSchedule: '0 0 * * *', // Update cache each day at midnight.
// Update cache each time data is accessed or written to from the GUI.
pullDeltaOnBeforeAccess: true,
pullDeltaOnAfterWrite: true,
// Delay all read requests by 50ms to allow request grouping.
pullDeltaOnBeforeAccessDelay: 50,
// Handler to the records that changed from the API.
pullDeltaHandler: async request => {
// Implement handler here
},
});Programming your handler
Example
Last updated