We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Какие могут проблемы в таком примере кода:
async function* eventStream(url) { const eventSource = new EventSource(url); while (true) { const event = await new Promise((resolve, reject) => { eventSource.onmessage = resolve; eventSource.onerror = reject; }); if (event.type === 'error') { eventSource.close(); throw event; } yield event.data; } } const url = "/live-feed"; for await (const message of eventStream(url)) { console.log("message:", message); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Какие могут проблемы в таком примере кода:
The text was updated successfully, but these errors were encountered: