Skip to main content

Interface: StatusUpdateHandlerOptions

Defined in: src/stores/sites/utils/statusUpdateHandler.ts:45

Configuration options for status update handler operations.

Remarksโ€‹

Defines the required dependencies and callbacks for managing status update subscriptions. All functions should be stable references to avoid unnecessary re-subscriptions.

Propertiesโ€‹

fullResyncSitesโ€‹

fullResyncSites: () => Promise<void>

Defined in: src/stores/sites/utils/statusUpdateHandler.ts:53

Function to trigger full sync from backend.

Returnsโ€‹

Promise<void>

Remarksโ€‹

Called when incremental updates fail or when a complete refresh is needed.


getSitesโ€‹

getSites: () => Site[]

Defined in: src/stores/sites/utils/statusUpdateHandler.ts:61

Function to get current sites array.

Returnsโ€‹

Site[]

Remarksโ€‹

Should return the current state of sites from the store.


onUpdate?โ€‹

optional onUpdate?: (update: StatusUpdate) => void

Defined in: src/stores/sites/utils/statusUpdateHandler.ts:70

Optional callback for additional processing of updates.

Parametersโ€‹

updateโ€‹

StatusUpdate

Returnsโ€‹

void

Remarksโ€‹

Called before applying the update to the store. Can be used for logging or side effects.


setSitesโ€‹

setSites: (sites: Site[]) => void

Defined in: src/stores/sites/utils/statusUpdateHandler.ts:78

Function to set sites array in store.

Parametersโ€‹

sitesโ€‹

Site[]

Returnsโ€‹

void

Remarksโ€‹

Should update the store with the new sites array.