react-native-sse icon indicating copy to clipboard operation
react-native-sse copied to clipboard

Create a similar library for reactjs

Open meirm opened this issue 1 year ago • 2 comments
trafficstars

I took the source code of the eventSource.js and used it in a reactjs app and worked like a charm, so this library is not limited to react-native. Great job.

meirm avatar Mar 23 '24 10:03 meirm

Yes, this library is based purely on XMLHttpRequest, so it will work pretty much anywhere. However, EventSource should work out of the box in reactjs, so you shouldn't even need this library there.

EmilJunker avatar Mar 23 '24 11:03 EmilJunker

The eventSource in reactjs doesn't support POST.

meirm avatar Mar 23 '24 11:03 meirm

@meirm Why do you require POST request? Alternatively You can use https://www.npmjs.com/package/event-source-polyfill

arpitmalik avatar Jun 03 '24 11:06 arpitmalik

You need POST request when you are using services such as OpenAI API in which you post the chat history (which is long) and get the results back as a stream.

meirm avatar Jun 03 '24 13:06 meirm