Skip to content

Commit 833edfc

Browse files
committed
Have .stream() return the ExtendedTask; Add a .clear() method
1 parent 3413029 commit 833edfc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

shiny/ui/_markdown_stream.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ async def _handle_error():
168168
await self._raise_exception(e)
169169
_handle_error.destroy() # type: ignore
170170

171+
return _task
172+
173+
async def clear(self):
174+
"""
175+
Clear the content of the markdown stream.
176+
"""
177+
return await self.stream([], clear=True)
178+
171179
@asynccontextmanager
172180
async def _streaming_dot(self):
173181
await self._send_stream_message(True)

0 commit comments

Comments
 (0)