Skip to content

@deltares/fews-web-oc-composables


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

Function: provideHostNotifications() ​

provideHostNotifications(notifications): void

Defined in: shared/hostNotifications.ts:51

Beta

Provides the host notifications implementation, making it available to micro-frontends via useHostNotifications.

Must be called by the host application before any micro-frontend that raises notifications is mounted.

Parameters ​

notifications ​

HostNotifications

The host notifications implementation to provide.

Returns ​

void

Example ​

ts
// Host application bootstrap
import { provideHostNotifications } from '@deltares/fews-web-oc-composables'

provideHostNotifications({
  addAlert: ({ type, message }) => showSnackbar(type, message),
})