mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-05-17 05:09:39 +03:00
Convert $connect and $disconnect to arrow functions
This commit is contained in:
+2
-2
@@ -9,12 +9,12 @@ export default {
|
||||
let observer = null
|
||||
|
||||
if (opts.connectManually) {
|
||||
Vue.prototype.$connect = function () {
|
||||
Vue.prototype.$connect = () => {
|
||||
observer = new Observer(connection, opts)
|
||||
Vue.prototype.$socket = observer.WebSocket
|
||||
}
|
||||
|
||||
Vue.prototype.$disconnect = function () {
|
||||
Vue.prototype.$disconnect = () => {
|
||||
if (observer && observer.reconnection) { observer.reconnection = false }
|
||||
if (Vue.prototype.$socket) {
|
||||
Vue.prototype.$socket.close()
|
||||
|
||||
Reference in New Issue
Block a user