Skip to content

Feature/add connect - #4

Open
alexanderkasten wants to merge 2 commits into
developfrom
feature/add_connect
Open

Feature/add connect#4
alexanderkasten wants to merge 2 commits into
developfrom
feature/add_connect

Conversation

@alexanderkasten

Copy link
Copy Markdown
Owner

This pull request introduces several enhancements to the Server-Sent Events (SSE) handling in the useSSE hook and the CounterWithDisconnect component. The main changes include adding a connect method to manage SSE connections more effectively and refactoring the cleanup logic.

Enhancements to SSE handling:

  • src/client/use-sse.ts: Added a connect method to the SSEResult interface to allow explicit connection management.
  • src/client/use-sse.ts: Introduced a cleanupRef to store the cleanup function and updated the close method to use this reference. This ensures proper cleanup of resources.
  • src/client/use-sse.ts: Refactored the useEffect to call the connect method directly and store the destructor in cleanupRef. This simplifies the connection management logic.

Updates to CounterWithDisconnect component:

@vercel

vercel Bot commented Dec 28, 2024

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v0-next-sse-r1gecphzhel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 28, 2024 4:45pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant