Skip to content

Remote Data

This basic example loads two bookings through HTTP. Use Reload bookings to fetch them again.

Loading Scheduler example…

Use remote when events or resources are too large to ship up front, or when the scheduler must load only the visible date range.

Remote loading and saving are independent. Configure loaders to fetch server data; add an optional mutation callback only when Scheduler should coordinate save acceptance and rollback. Applications own HTTP calls, authorization and durable storage.

import type { EventSchedulerConfig } from '@revolist/scheduler';
const remote: EventSchedulerConfig['remote'] = {
enabled: true,
mode: 'remote',
loadEvents: async ({ startDateTime, endDateTime, signal }) => {
const params = new URLSearchParams({
start: startDateTime!,
end: endDateTime!,
});
const response = await fetch(`/api/scheduler/events?${params}`, { signal });
if (!response.ok) throw new Error('Unable to load events');
return { events: await response.json() };
},
loadResources: async ({ signal }) => {
const response = await fetch('/api/scheduler/resources', { signal });
if (!response.ok) throw new Error('Unable to load resources');
return { resources: await response.json() };
},
query: { refetchInterval: 5_000, retry: 2 },
};

See the server-side example for a runnable application adapter in TypeScript, React, Vue and Angular.

All six existing loaders use the shared query engine without changing their callback signatures: loadEvents, loadResources, loadAvailability, loadCoverage, loadUnassignedEvents, and loadResourceChildren. Add optional remote.query to control native TanStack freshness, retry, polling, focus and reconnect behavior. See Scheduler query usage and types and the complete configuration table.

import type { EventSchedulerRemoteQueryOptions } from '@revolist/scheduler';
const query: EventSchedulerRemoteQueryOptions = {
refetchInterval: 5_000,
refetchIntervalInBackground: false,
refetchOnWindowFocus: true,
retry: 2,
};
// Keep every existing loader; add query to the remote object.
grid.eventScheduler = {
...grid.eventScheduler,
remote: { ...grid.eventScheduler.remote, query },
};

Reads default to staleTime: 0. Each Scheduler owns a private query context unless you supply query.source. Share a source only across equivalent dataset, schema, tenant and authorization scopes; it coalesces overlapping in-flight requests. Loaded values are cloned for each view. Mounted range and resource observers keep native refetch options active until scope replacement, remote disable or grid destruction. Removing one grid leaves shared peers subscribed; removing the last subscriber aborts its transport and stops polling. Pass the supplied signal to fetch to release backend work promptly.

Root resources keep their loaded cursor pages. Refetch restarts from the first page and derives later cursors from the refreshed responses. Child loaders still traverse all pages automatically; a failing or non-progressing page retains already accepted pages and can be retried with scheduler.loadResourceChildren(parentId, true). Availability, coverage and independent child-route errors do not erase other accepted data. Pending event changes and assignment sidecars remain protected during refetch.

Use query: false to opt out of the cache and native automatic refetch while retaining manual loading. Assign a new configuration object when changing query policy or loader functions. Ordinary commitMutation callbacks and refreshPolicy keep their existing behavior. Receipt-based writes can explicitly share commands.source with query.source to fence stale reads across views; see command receipts.

Remote mode can load events, resources, availability, unassigned demand, and coverage for the visible range. Saving is configured separately through mutation hooks.

const eventScheduler = {
view: 'resourceTimeline',
weekStartDate: '2026-06-08',
dateRange: { start: '2026-06-08', end: '2026-06-14' },
remote: {
enabled: true,
mode: 'remote',
debounceMs: 150,
overscanDays: 1,
resourcePageSize: 50,
loadEvents: ({ dateRange, filters, signal }) =>
api.loadEvents({ dateRange, filters }, { signal }),
loadResources: ({ cursor, limit, signal }) =>
api.loadResources({ cursor, limit }, { signal }),
loadAvailability: ({ dateRange, signal }) =>
api.loadAvailability({ dateRange }, { signal }),
loadCoverage: ({ dateRange, signal }) =>
api.loadCoverage({ dateRange }, { signal }),
},
};

Remote modes:

ModeBehavior
localRemote controller is effectively off unless enabled hooks are used by the host.
remoteVisible data is loaded through remote hooks.
hybridHost can combine local side-channel data with remote range data.

Remote state is available from scheduler.getRemoteState(). The plugin emits:

EventPurpose
event-scheduler-remote-load-startA visible-range load begins.
event-scheduler-remote-load-successA load target resolves.
event-scheduler-remote-load-errorA load target fails.
event-scheduler-remote-state-changeLoading, error, pending, paging, or empty state changes.

Use scheduler.refreshVisibleRange() to reload the current range and scheduler.loadMoreResources() when paged resources report hasMoreResources.

Scheduler range, root-resource and child-resource reads use the same engine. Keep all existing loaders and add remote.query when you need native policy. See Scheduler remote data for paging, pending-edit reconciliation and lifecycle details.

Type / propertyContract
EventSchedulerRemoteConfig.queryEventSchedulerRemoteQueryOptions | false; optional, default fresh reads with a private scope.
EventSchedulerRemoteQueryOptionsOmit<LoadQueryOptions<never>, 'consistency' | 'reconcile'>, exported by @revolist/scheduler. All native fields from configuration types apply to mounted observers.
query.sourceOptional DataQueryScope; create with createDataQueryContext from @revolist/revogrid-pro. Use the same source for equivalent views; dispose it after destroying its grids.
query: falseDirect reads with manual refresh; disables query caching and native polling/retry policy.
import { createDataQueryContext } from '@revolist/revogrid-pro';
import type { EventSchedulerRemoteQueryOptions } from '@revolist/scheduler';
const context = createDataQueryContext();
const source = context.source({
sourceId: 'schedule',
schemaId: 'v1',
tenantId: 'tenant-1',
authorizationScope: 'schedule-reader',
});
const query: EventSchedulerRemoteQueryOptions = {
source,
refetchInterval: 5_000,
retry: 2,
refetchOnWindowFocus: true,
refetchOnReconnect: true,
};
// Use { ...existingRemote, query } in each equivalent Scheduler.
// Destroy the grids, then context.dispose().

After a confirmed save, refreshPolicy: 'changed-range' refreshes the affected dates through the current read provider. Replacing loaders or the query scope cannot revive an earlier provider or detach the replacement’s polling. Returned assignment sidecars replace that event partition; unrelated rows and newer local assignment edits are preserved. Obsolete refresh results and errors are ignored.

The six independent operations are events, resources, availability, coverage, unassigned events and resource children. Keys include timezone, half-open instant bounds, civil date range, view, filters, visible resource IDs, parent and page size. Cursor sequences own their page parameters; physical request IDs are excluded from semantic identity. Root-resource subscriptions survive event viewport changes caused by resource hydration. Child subscriptions remain active after initial traversal. Native polling and refetch stop when the owning grid is destroyed or remote loading is disabled. Promise callers settle when cancelled even if a loader ignores abort.

Polling replaces each target’s accepted projection while preserving pending event and assignment proposals. An unchanged successful frame also settles loading and clears that route’s prior error. Failed targets preserve accepted data and do not prevent other targets from updating. Scheduler keeps debounce, overscan, timezone, projection and history ownership; Query owns cache, attempts and native read policy.

See Scheduler command receipts for write configuration and recovery.