<template>
  <div class="stomp-wrapper">
    <slot :stomp-client="stompClient" :connected="connected"></slot>
  </div>
</template>


<script>
module.exports = {
  name: "StompWrapper",
  data() {
    return {
      stompClient: new ReconnectingStompClient("/wsms", {
        onConnect: () => this.connected = true,
        onDisconnect: () => this.connected = false
      }),
      connected: false
    };
  },
  beforeDestroy() {
    this.stompClient.disconnect();
  }
}
</script>

<style scoped>
</style>

<style>
</style>