33const { startTimer, stopTimer } = require ( './timer' ) ;
44
55const campbellsTomatoSoup = {
6- brand : ' Campbell\'s' ,
7- contents : 'tomato soup'
6+ brand : " Campbell's" ,
7+ contents : 'tomato soup' ,
88} ;
99
1010function say ( message ) {
@@ -14,7 +14,7 @@ function say(message) {
1414function openCan ( foodCan ) {
1515 const { brand, contents } = foodCan ;
1616 say ( `Using can opener to open a can of ${ brand } ${ contents } .` ) ;
17- return new Promise ( ( resolve ) => {
17+ return new Promise ( resolve => {
1818 setTimeout ( ( ) => {
1919 say ( `Opened the can of ${ contents } .` ) ;
2020 resolve ( contents ) ;
@@ -24,7 +24,7 @@ function openCan(foodCan) {
2424
2525function warmUp ( food ) {
2626 say ( `Warming up the ${ food } .` ) ;
27- return new Promise ( ( resolve ) => {
27+ return new Promise ( resolve => {
2828 setTimeout ( ( ) => {
2929 say ( `Warmed up the ${ food } .` ) ;
3030 resolve ( 'hot ' + food ) ;
@@ -33,7 +33,7 @@ function warmUp(food) {
3333}
3434
3535function eat ( food ) {
36- return new Promise ( ( resolve ) => {
36+ return new Promise ( resolve => {
3737 say ( `Eating the ${ food } .` ) ;
3838 setTimeout ( ( ) => {
3939 say ( `Finished the ${ food } .` ) ;
@@ -49,13 +49,12 @@ function eatLunch(foodCan) {
4949}
5050
5151function main ( ) {
52- say ( 'It\ 's lunch time!' ) ;
52+ say ( "It 's lunch time!" ) ;
5353 startTimer ( counter => say ( counter ) ) ;
54- eatLunch ( campbellsTomatoSoup )
55- . then ( ( ) => {
56- stopTimer ( ) ;
57- say ( 'Finished lunch' ) ;
58- } ) ;
54+ eatLunch ( campbellsTomatoSoup ) . then ( ( ) => {
55+ stopTimer ( ) ;
56+ say ( 'Finished lunch' ) ;
57+ } ) ;
5958}
6059
6160main ( ) ;
0 commit comments