Skip to content

Commit

Permalink
fullscreen.state.get: UseBooleanGet integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Stassi committed Nov 15, 2024
1 parent 4040f07 commit 88aca59
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/leaf/map/fullscreen/control/control-added-listener.ts
Original file line number Diff line number Diff line change
@@ -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 } }
}
}

Expand All @@ -44,7 +41,9 @@ export function controlAddedListener({
assign: anchorAssign,
titleStates: anchorTitleStates,
},
fullscreen: getFullscreenState(),
fullscreen: {
state: { get: getFullscreenState },
},
})

anchorOnClick(async function handleAnchorClick(e: Event): Promise<void> {
Expand Down

0 comments on commit 88aca59

Please sign in to comment.