✨ streaming

This commit is contained in:
Nate Sesti 2024-02-14 18:47:29 -08:00
parent cc9f057454
commit 3a39b4b28c

View file

@ -65,7 +65,17 @@ export class VsCodeWebviewProtocol {
for (const handler of handlers) {
try {
const response = await handler(msg);
respond(response || {});
if (
response &&
typeof response[Symbol.asyncIterator] === "function"
) {
for await (const update of response) {
respond(update);
}
respond({ done: true });
} else {
respond(response || {});
}
} catch (e: any) {
console.error(
"Error handling webview message: " +