Skip to content
New issue

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

Create a similar library for reactjs #50

Open
meirm opened this issue Mar 23, 2024 · 4 comments
Open

Create a similar library for reactjs #50

meirm opened this issue Mar 23, 2024 · 4 comments

Comments

@meirm
Copy link

meirm commented Mar 23, 2024

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.

@EmilJunker
Copy link
Contributor

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.

@meirm
Copy link
Author

meirm commented Mar 23, 2024

The eventSource in reactjs doesn't support POST.

@arpitmalik
Copy link

arpitmalik commented Jun 3, 2024

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

@meirm
Copy link
Author

meirm commented Jun 3, 2024

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.

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

No branches or pull requests

3 participants