We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b2ca96 commit 3277bcaCopy full SHA for 3277bca
README.md
@@ -51,11 +51,23 @@ es.addEventListener("error", (event) => {
51
}
52
});
53
54
+es.addEventListener("done", (event) => {
55
+ console.log("Done SSE connection.");
56
+});
57
+
58
es.addEventListener("close", (event) => {
59
console.log("Close SSE connection.");
60
61
```
62
63
+### Done vs Close
64
65
+`done` events will fire when server closes the connection.
66
+Reconnections will occur indefinitely, unless this behavior is disabled.
67
+`close` events will fire when the connection is terminated by the client, using `.close()`.
68
69
+### Headers and params
70
71
If you want to use Bearer token and/or topics, look at this example (TypeScript):
72
73
```typescript
0 commit comments