mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-06-23 16:20:36 +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
|
let observer = null
|
||||||
|
|
||||||
if (opts.connectManually) {
|
if (opts.connectManually) {
|
||||||
Vue.prototype.$connect = function () {
|
Vue.prototype.$connect = () => {
|
||||||
observer = new Observer(connection, opts)
|
observer = new Observer(connection, opts)
|
||||||
Vue.prototype.$socket = observer.WebSocket
|
Vue.prototype.$socket = observer.WebSocket
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.prototype.$disconnect = function () {
|
Vue.prototype.$disconnect = () => {
|
||||||
if (observer && observer.reconnection) { observer.reconnection = false }
|
if (observer && observer.reconnection) { observer.reconnection = false }
|
||||||
if (Vue.prototype.$socket) {
|
if (Vue.prototype.$socket) {
|
||||||
Vue.prototype.$socket.close()
|
Vue.prototype.$socket.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user