Giter Club home page Giter Club logo

react-native-eventsource's People

Contributors

iday avatar jonnybgod avatar ramideas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-eventsource's Issues

only data field accessible

sse has more than a data field. It can include an event, or id (amongst some others). event in this lib should conform sse events.

All event types are assumed to be 'message'

On android, at least (I haven't tested iOS)

No matter what the event type, the data is sent to the onmessage handler

For example, the following SSE stream should be delivered to a function registered with .addEventListener( 'change', fn ) but instead is delivered to the function registered with .addEventListener( 'message', fn )

...

event: change
data: {"prop":"one","value":1}

...

Could not receive any message type except "ping"

Hello! I'm trying to use your module to get SSE from YouTrack service.
But the only message I receive is with type "ping". Server should send lot of event types except "ping", and they have big "data" in them, but I receive only "ping". That's strange.

I guess it could be because react-native-eventsource misses URL query parameters, because server sends messages only if I request them in query. Could it be possible?

I don't know what additional information I can gather and would appreciate if you suggest something.

Cannot read property 'connect' of undefined

I am facing a problem trying to initialize the EventSource.

componentDidMount() {
    this.source = new EventSource("url_to_my_channel");

    this.source.onopen = () => console.log("EventSource::Connection open");

    this.source.onmessage = (message) => console.log("EventSource::onMessage", message);

    this.source.onerror = (error) => console.log("EventSource::error", error);

    this.source.addEventListener("custom_event", (event) => console.log("EventSource::custom_event", event))
  }

I am using this implementation of Push Stream.

It don't show the information

Hi @JonnyBGod , I have been working sse with 'spring boot' and 'react native' and I find that the information data is not displayed, when I check the search package 'EventSource.js' that I find in funtion_registerEvents in specific' DeviceEventEmitter .addListener ('eventsourceEvent', 'you send ev.message instead of sen ev.data when i do it this change all working and can show information data, will can you do this change ?

before
var event = new EventSourceEvent(ev.type, {
data: ev.message
});

after
var event = new EventSourceEvent(ev.type, {
data: ev.data
});

thanks , for your time , good day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.