From 88aca5994cdf13c35723c100ba7d6803aa0d757a Mon Sep 17 00:00:00 2001 From: Andreas Stassivik Date: Fri, 15 Nov 2024 14:23:28 -0800 Subject: [PATCH] `fullscreen.state.get: UseBooleanGet` integration --- .../fullscreen/control/control-added-listener.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/leaf/map/fullscreen/control/control-added-listener.ts b/src/leaf/map/fullscreen/control/control-added-listener.ts index 3c415f2..82c666e 100644 --- a/src/leaf/map/fullscreen/control/control-added-listener.ts +++ b/src/leaf/map/fullscreen/control/control-added-listener.ts @@ -1,23 +1,20 @@ import { DomEvent, type Map } from 'leaflet' import { type UseAnchor } from '../state/use-anchor' +import { type UseBooleanGet } from '../state/use-boolean' import { + type AnchorAssignTitleOptions, setControlAnchorTitle, - type SetControlAnchorTitleOptions, } from './set-control-anchor-title' export type ControlAddedListenerOptions = { map: { control: { - anchor: { - assign: UseAnchor['assign'] - onClick: UseAnchor['onClick'] - titleStates: SetControlAnchorTitleOptions['anchor']['titleStates'] - } + anchor: AnchorAssignTitleOptions & UseAnchor container: { element: HTMLElement } } - fullscreen: { state: { get: () => boolean } } + fullscreen: { state: { get: UseBooleanGet } } } } @@ -44,7 +41,9 @@ export function controlAddedListener({ assign: anchorAssign, titleStates: anchorTitleStates, }, - fullscreen: getFullscreenState(), + fullscreen: { + state: { get: getFullscreenState }, + }, }) anchorOnClick(async function handleAnchorClick(e: Event): Promise {