Created
June 13, 2024 16:58
-
-
Save engineersamuel/14d6ec613ec537c9c0c41f1ab4824544 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await getBytes(response.body!, getLines(getMessages(id => { | |
if (id) { | |
// store the id and send it back on the next retry: | |
headers[LastEventId] = id; | |
} else { | |
// don't send the last-event-id header anymore: | |
delete headers[LastEventId]; | |
} | |
}, retry => { | |
retryInterval = retry; | |
}, onmessage))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment