How to use the vue-composable.useWebSocket function in vue-composable

To help you get started, we’ve selected a few vue-composable examples, based on popular ways it is used in public projects.

github pikax / vue-composable / docs / .vuepress / components / WebSocketExample.vue View on Github external
setup() {
    const { isOpen, isClosed, data, errored, send, close } = useWebSocket(
      "wss://javascript.info/article/websocket/demo/hello"
    );

    return {
      isOpen,
      isClosed,
      data,
      errored,
      send,
      close
    };
  }
};