lahsivjar / react-stomp

React websocket component for STOMP protocol over SockJs
https://www.npmjs.com/package/react-stomp
MIT License
134 stars 41 forks source link

Not able to retrieve user-name from frame returned by connection callback function #171

Open psggit opened 3 years ago

psggit commented 3 years ago

**_Expected Change:

this.client.connect(this.props.headers, (frame) => { console.log("frame", frame) this.setState({ connected: true }) this.props.topics.forEach((topic) => { this._subscribe(topic) }) this.props.onConnect(frame) }, (error) => { if (error) { if (Object.keys(this.props).includes('onConnectFailure')) { this.props.onConnectFailure(error) } else { this._log(error.stack) } } if (this.state.connected) { this._cleanUp() // onDisconnect should be called only once per connect this.props.onDisconnect() } if (this.props.autoReconnect && !this.state.explicitDisconnect) { this._timeoutId = setTimeout(this.connect, this.props.getRetryInterval(this.retryCount++)) } })**