Skip to content

Commit 5089b99

Browse files
committed
Have the stream task return the accumulated string result
1 parent 833edfc commit 5089b99

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shiny/ui/_markdown_stream.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,15 @@ async def stream(
153153
async def _task():
154154
if clear:
155155
await self._send_content_message("", "replace")
156+
157+
result = ""
156158
async with self._streaming_dot():
157159
async for c in content:
160+
result += c
158161
await self._send_content_message(c, "append")
159162

163+
return result
164+
160165
_task()
161166

162167
# Since the task runs in the background (outside/beyond the current context,

0 commit comments

Comments
 (0)