chore(eslint): disable types on complicated event handlers
This commit is contained in:
parent
4e218ba562
commit
96e9024694
1 changed files with 4 additions and 0 deletions
|
@ -50,12 +50,16 @@ export function useMapEvent(
|
||||||
const map = useMapLibre();
|
const map = useMapLibre();
|
||||||
return useEffect(() => {
|
return useEffect(() => {
|
||||||
if (target) {
|
if (target) {
|
||||||
|
// event typing is hard
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
map.on(eventName as keyof MapLayerEventType, target, callback as any);
|
map.on(eventName as keyof MapLayerEventType, target, callback as any);
|
||||||
} else {
|
} else {
|
||||||
map.on(eventName, callback);
|
map.on(eventName, callback);
|
||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
if (target) {
|
if (target) {
|
||||||
|
// event typing is hard
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
map.off(eventName as keyof MapLayerEventType, target, callback as any);
|
map.off(eventName as keyof MapLayerEventType, target, callback as any);
|
||||||
} else {
|
} else {
|
||||||
map.off(eventName, callback);
|
map.off(eventName, callback);
|
||||||
|
|
Loading…
Add table
Reference in a new issue