Skip to main content

Interface: StatusUpdateHandlerOptions

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

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โ€‹

fullSyncFromBackend()โ€‹

fullSyncFromBackend: () => Promise<void>

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

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:66

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:75

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:83

Function to set sites array in store.

Parametersโ€‹

sitesโ€‹

Site[]

Returnsโ€‹

void

Remarksโ€‹

Should update the store with the new sites array.