@deltares/fews-web-oc-composables
@deltares/fews-web-oc-composables / provideHostRefreshContext
Function: provideHostRefreshContext()
provideHostRefreshContext(
context):void
Defined in: shared/hostRefreshContext.ts:40
Beta
Provides the host refresh context, making it available to micro-frontends via useHostRefreshContext.
Must be called by the host application before any micro-frontend that relies on onSystemTick refreshes is mounted.
Parameters
context
The refresh context to provide, including the systemTick ref.
Returns
void
Example
ts
// Host application bootstrap
import { ref } from 'vue'
import { provideHostRefreshContext } from '@deltares/fews-web-oc-composables'
const systemTick = ref<Date>()
setInterval(() => { systemTick.value = new Date() }, 60_000)
provideHostRefreshContext({ systemTick })