-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Explicitly casting handleLocalChange to EventListener (handleLocalChange as EventListener) can mask potential type mismatches. While it might work, it's generally safer to ensure type safety by defining handleLocalChange with the correct CustomEvent type or by adding a runtime check for event.detail within the handler. This improves code clarity and reduces the risk of unexpected behavior if the event structure changes.
Reference:
window.addEventListener("local-apikey-change", handleLocalChange as EventListener)Source: web/hooks/useApiKey.ts line 25.
Metadata
Metadata
Assignees
Labels
No labels