Skip to content

Commit 13fae72

Browse files
committed
Fix overloads
1 parent 6033d27 commit 13fae72

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/reactpy/core/hooks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,15 @@ async def effect(stop: asyncio.Event) -> None:
173173
def use_async_effect(
174174
function: None = None,
175175
dependencies: Sequence[Any] | ellipsis | None = ...,
176+
shutdown_timeout: float = 0.1,
176177
) -> Callable[[_EffectApplyFunc], None]: ...
177178

178179

179180
@overload
180181
def use_async_effect(
181182
function: _AsyncEffectFunc,
182183
dependencies: Sequence[Any] | ellipsis | None = ...,
184+
shutdown_timeout: float = 0.1,
183185
) -> None: ...
184186

185187

@@ -227,8 +229,8 @@ async def effect(stop: asyncio.Event) -> None:
227229
# Wait until we get the signal to stop this effect
228230
await stop.wait()
229231

230-
# If renders are queued back-to-back, then this effect function might have
231-
# not completed. So, we give the task a small amount of time to finish.
232+
# If renders are queued back-to-back, the effect might not have
233+
# completed. So, we give the task a small amount of time to finish.
232234
# If it manages to finish, we can obtain a clean-up function.
233235
results, _ = await asyncio.wait([task], timeout=shutdown_timeout)
234236
if results:

0 commit comments

Comments
 (0)