Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
botre committed May 16, 2019
1 parent ea2884d commit 42e4959
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/vue-connection-listener.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
export default class VueConnectionListener {
constructor(bus) {
this.bus = bus;
this.listener = () => {
this.bus.$emit('connection', navigator.onLine || false);
}
this.bus = bus;
this.listener = () => {
this.bus.$emit("connection", navigator.onLine || false);
};
}
register() {
const self = this;
window.addEventListener('load', function () {
window.addEventListener('online', self.listener);
window.addEventListener('offline', self.listener);
});
const self = this;
window.addEventListener("load", function() {
window.addEventListener("online", self.listener);
window.addEventListener("offline", self.listener);
});
}
unregister() {
const self = this;
window.removeEventListener('online', self.listener);
window.removeEventListener('offline', self.listener);
const self = this;
window.removeEventListener("online", self.listener);
window.removeEventListener("offline", self.listener);
}
}
}

0 comments on commit 42e4959

Please sign in to comment.