Skip to content

Commit 023beab

Browse files
committed
Fix code style
1 parent 93f0990 commit 023beab

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

JavaScript/6-listener.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const iterate = (array, listener) => {
88

99
const cities = ['Kiev', 'London', 'Beijing'];
1010

11-
const print = city => {
11+
const print = (city) => {
1212
console.log('City:', city);
1313
};
1414

JavaScript/7-listener-timer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ const iterate = (array, listener) => {
1111

1212
const cities = ['Kiev', 'London', 'Beijing'];
1313

14-
const print = city => console.log('Next city:', city);
14+
const print = (city) => console.log('Next city:', city);
1515

1616
iterate(cities, print);

JavaScript/8-event.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
const adder = initial => {
3+
const adder = (initial) => {
44
let value = initial;
5-
const add = delta => {
5+
const add = (delta) => {
66
value += delta;
77
if (value >= add.maxValue) add.maxEvent(value);
88
return add;
@@ -17,7 +17,7 @@ const adder = initial => {
1717

1818
// Usage
1919

20-
const maxReached = value => {
20+
const maxReached = (value) => {
2121
console.log('max value reached, value: ' + value);
2222
};
2323

JavaScript/9-event-emitter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ const { EventEmitter } = require('events');
44

55
const emitter = new EventEmitter();
66

7-
emitter.on('new city', city => {
7+
emitter.on('new city', (city) => {
88
console.log('Emitted city:', city);
99
});
1010

11-
emitter.on('data', array => {
11+
emitter.on('data', (array) => {
1212
console.log(array.reduce((a, b) => a + b));
1313
});
1414

JavaScript/a-deferred.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ class Deferred {
1313
this.value = value;
1414
this.finished = true;
1515
const event = this.events['done'];
16-
if (event) event.forEach(fn => fn(value));
16+
if (event) event.forEach((fn) => fn(value));
1717
}
1818

1919
reject(err) {
2020
if (this.finished) return;
2121
this.error = err;
2222
this.finished = true;
2323
const event = this.events['fail'];
24-
if (event) event.forEach(fn => fn(err));
24+
if (event) event.forEach((fn) => fn(err));
2525
}
2626

2727
done(fn) {
@@ -44,10 +44,10 @@ class Deferred {
4444
// Usage
4545

4646
const conferences = new Deferred()
47-
.done(list => {
47+
.done((list) => {
4848
console.log(list);
4949
})
50-
.fail(err => {
50+
.fail((err) => {
5151
throw err;
5252
});
5353

JavaScript/b-errors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// Implementation
44

5-
const adder = value => {
6-
const add = a => {
5+
const adder = (value) => {
6+
const add = (a) => {
77
value += a;
88
if (value >= add.maxValue) {
99
setImmediate(() => {

0 commit comments

Comments
 (0)