File tree 4 files changed +8
-8
lines changed
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const adder = ( initial ) => {
3
+ const adder = initial => {
4
4
let value = initial ;
5
- const add = ( delta ) => {
5
+ const add = delta => {
6
6
value += delta ;
7
7
if ( value >= add . maxValue ) add . maxEvent ( value ) ;
8
8
return add ;
@@ -17,7 +17,7 @@ const adder = (initial) => {
17
17
18
18
// Usage
19
19
20
- const maxReached = ( value ) => {
20
+ const maxReached = value => {
21
21
console . log ( 'max value reached, value: ' + value ) ;
22
22
} ;
23
23
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ const events = require('events');
4
4
5
5
const emitter = new events . EventEmitter ( ) ;
6
6
7
- emitter . on ( 'new city' , ( city ) => {
7
+ emitter . on ( 'new city' , city => {
8
8
console . log ( 'Emitted city: ' + city ) ;
9
9
} ) ;
10
10
11
- emitter . on ( 'data' , ( array ) => {
11
+ emitter . on ( 'data' , array => {
12
12
console . log ( array . reduce ( ( a , b ) => a + b ) ) ;
13
13
} ) ;
14
14
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const conferences = getConferences();
17
17
18
18
console . log ( conferences ) ;
19
19
20
- conferences . data ( ( list ) => {
20
+ conferences . data ( list => {
21
21
console . log ( list ) ;
22
22
} ) ;
23
23
Original file line number Diff line number Diff line change 2
2
3
3
// Implementation
4
4
5
- const adder = ( value ) => {
6
- const add = ( a ) => {
5
+ const adder = value => {
6
+ const add = a => {
7
7
value += a ;
8
8
if ( value >= add . maxValue ) {
9
9
setImmediate ( ( ) => {
You can’t perform that action at this time.
0 commit comments