2
0
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:
Will McNaughton
2018-04-03 09:54:24 -05:00
parent 0341c1ca03
commit 0494c1388a
+2 -2
View File
@@ -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()