Use fat arrow functions const foo = () => { ... }; for callbacks

and any other function that is passed around and it's not a top level function
This commit is contained in:
Juanjo Diaz
2018-07-09 22:47:29 +02:00
parent 0e4808bf6f
commit 651c23ece3
28 changed files with 177 additions and 191 deletions

View File

@@ -74,7 +74,7 @@ FakeWebSocket.CLOSED = WebSocket.CLOSED;
FakeWebSocket.__is_fake = true;
FakeWebSocket.replace = function () {
FakeWebSocket.replace = () => {
if (!WebSocket.__is_fake) {
const real_version = WebSocket;
// eslint-disable-next-line no-global-assign
@@ -83,7 +83,7 @@ FakeWebSocket.replace = function () {
}
};
FakeWebSocket.restore = function () {
FakeWebSocket.restore = () => {
if (WebSocket.__is_fake) {
// eslint-disable-next-line no-global-assign
WebSocket = WebSocket.__real_version;