Skip to content

Commit b09d86e

Browse files
committed
Provide typedef for update callable
1 parent 31d9be8 commit b09d86e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

click_async_plugins/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ async def run_plugins(
112112
logger.debug("Finished.")
113113

114114

115+
type UpdateCallbackType[T] = Callable[[T], Coroutine[None, None, None]]
116+
117+
115118
async def react_to_data_update[T](
116-
updates_gen: AsyncGenerator[T],
117-
*,
118-
callback: Callable[[T], Coroutine[None, None, None]],
119+
updates_gen: AsyncGenerator[T], *, callback: UpdateCallbackType[T]
119120
) -> None:
120121
try:
121122
async for update in updates_gen:

0 commit comments

Comments
 (0)