From 24a3cf9ba18ea8601d5a98564d7a85c165e99db2 Mon Sep 17 00:00:00 2001 From: Masahiro Wada Date: Tue, 31 May 2022 07:17:20 +0000 Subject: [PATCH] fix: Fix type hint errors --- alfort_dom/app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/alfort_dom/app.py b/alfort_dom/app.py index 8852b00..2a74f1d 100755 --- a/alfort_dom/app.py +++ b/alfort_dom/app.py @@ -27,14 +27,12 @@ def _render(_: Any) -> None: class DomNode(Node, Generic[M]): dom: HTMLElement dispatch: Dispatch[M] - handlers: dict[str, Callable[[Any], None]] + handlers: dict[str, Callable[[Any], M]] listener: JsProxy - def __init__( - self, dom: HTMLElement, dispatch: Dispatch[M] = lambda _: None - ) -> None: + def __init__(self, dom: HTMLElement, dispatch: Dispatch[M] | None = None) -> None: self.dom = dom - self.dispatch = dispatch + self.dispatch = dispatch if dispatch is not None else lambda _: None self.handlers = {} def _listener(event: Any) -> None: