Skip to content

Commit

Permalink
Pass a copy of subscribeHeaders to stompJs#subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
lahsivjar authored and lahsivjar committed Jan 16, 2021
1 parent c9e5862 commit de7882f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client.jsx
Expand Up @@ -176,9 +176,10 @@ class SockJsClient extends React.Component {

_subscribe = (topic) => {
if (!this.subscriptions.has(topic)) {
const subscribeHeaders = Object.assign({}, this.props.subscribeHeaders)
let sub = this.client.subscribe(topic, (msg) => {
this.props.onMessage(this._processMessage(msg.body), msg.headers.destination)
}, this.props.subscribeHeaders)
}, subscribeHeaders)
this.subscriptions.set(topic, sub)
}
}
Expand Down

1 comment on commit de7882f

@vuquanglong2707
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Please sign in to comment.