@deltares/fews-web-oc-composables
@deltares/fews-web-oc-composables / createDateRegistry
Function: createDateRegistry()
createDateRegistry():
object
Defined in: useDateRegistry/index.ts:44
Beta
Creates a registry that collects Date[] refs registered by descendant components (via useDateRegistry) and combines them into a single, de-duplicated, sorted list of dates.
Must be called from setup() of an ancestor component, since it uses provide() to make the registry available to descendants.
Returns
object
An object containing combinedDates, a computed Date[] ref with the sorted union of all dates registered by descendants.
combinedDates
combinedDates:
ComputedRef<Date[]>
Example
ts
// ParentComponent.vue
import { createDateRegistry } from '@deltares/fews-web-oc-composables'
const { combinedDates } = createDateRegistry()