Skip to content

Commit fa35d05

Browse files
committed
fix LayoutType
1 parent 055da77 commit fa35d05

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/idom/core/types.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def should_render(self: _OwnType, new: _OwnType) -> bool:
5151
"""Whether the new component instance should be rendered."""
5252

5353

54-
_Self = TypeVar("_Self")
5554
_Render = TypeVar("_Render", covariant=True)
5655
_Event = TypeVar("_Event", contravariant=True)
5756

@@ -66,11 +65,14 @@ async def render(self) -> _Render:
6665
async def deliver(self, event: _Event) -> None:
6766
"""Relay an event to its respective handler"""
6867

69-
def __enter__(self: _Self) -> _Self:
68+
async def __aenter__(self) -> LayoutType:
7069
"""Prepare the layout for its first render"""
7170

72-
def __exit__(
73-
self, exc_type: Type[Exception], exc_value: Exception, traceback: TracebackType
71+
async def __aexit__(
72+
self,
73+
exc_type: Type[Exception],
74+
exc_value: Exception,
75+
traceback: TracebackType,
7476
) -> Optional[bool]:
7577
"""Clean up the view after its final render"""
7678

0 commit comments

Comments
 (0)