Skip to content

@deltares/fews-web-oc-composables


@deltares/fews-web-oc-composables / useHostRefreshContext

Function: useHostRefreshContext() ​

useHostRefreshContext(): HostRefreshContext

Defined in: shared/hostRefreshContext.ts:61

Beta

Retrieves the host refresh context that was previously provided via provideHostRefreshContext.

Returns ​

HostRefreshContext

MemberTypeDescription
systemTickRef<Date | undefined>A ref that the host updates on a regular interval (e.g. every minute) to act as a shared "system time" signal. Composables such as useRefreshCoordinator watch this ref to trigger onSystemTick refreshes without each one needing its own timer.

The host refresh context.

Throws ​

When no host refresh context has been provided yet.

Example ​

ts
import { useHostRefreshContext } from '@deltares/fews-web-oc-composables'

const { systemTick } = useHostRefreshContext()