updateEventSource(city) {
    console.log("setting new event source to ", city);
    let eventSource = new EventSource(
      `${this.state.streamEndpoint}/api/v0/new-event-stream/${city}`
    );
    eventSource.onmessage = (e) => this.updateEventList(JSON.parse(e.data));

    this.setState({
      eventSource: eventSource,
    });
  }
// start a new connection for new event push notifications
start a new connection for new event push notifications
start a new connection for new event push notifications
updateEventSource(city) {
    console.log("setting new event source to ", city);
    let eventSource = new EventSource(
      `${this.state.streamEndpoint}/api/v0/new-event-stream/${city}`
    );
    eventSource.onmessage = (e) => this.updateEventList(JSON.parse(e.data));
    this.setState({
      eventSource: eventSource,
    });
  }
updateEventSource ( city ) { console . log ( "setting new event source to " , city ) ; let eventSource = new EventSource ( ` ${ this . state . streamEndpoint } ${ city } ` ) ; eventSource . onmessage = ( e ) => this . updateEventList ( JSON . parse ( e . data ) ) ; this . setState ( { eventSource : eventSource , } ) ; }
start a new connection for new event push notifications
start a new connection for new event push notifications