File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ const events = require('events');
44
55const emitter = new events . 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
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const conferences = getConferences();
1717
1818console . log ( conferences ) ;
1919
20- conferences . data ( ( list ) => {
20+ conferences . data ( list => {
2121 console . log ( list ) ;
2222} ) ;
2323
Original file line number Diff line number Diff line change 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 ( ( ) => {
You can’t perform that action at this time.
0 commit comments