@@ -70,12 +70,12 @@ For sync hooks, `tap` is the only valid method to add a plugin. Async hooks also
7070``` js
7171myCar .hooks .calculateRoutes .tapPromise (
7272 " GoogleMapsPlugin" ,
73- (source , target , routesList ) => {
73+ (source , target , routesList ) =>
7474 // return a promise
75- return google .maps .findRoute (source, target).then ((route ) => {
75+ google .maps .findRoute (source, target).then ((route ) => {
7676 routesList .add (route);
77- });
78- }
77+ })
78+
7979);
8080myCar .hooks .calculateRoutes .tapAsync (
8181 " BingMapsPlugin" ,
@@ -106,7 +106,7 @@ class Car {
106106 /**
107107 * You won't get returned value from SyncHook or AsyncParallelHook,
108108 * to do that, use SyncWaterfallHook and AsyncSeriesWaterfallHook respectively
109- ** /
109+ */
110110
111111 setSpeed (newSpeed ) {
112112 // following call returns undefined even when you returned values
@@ -117,10 +117,10 @@ class Car {
117117 const routesList = new List ();
118118 return this .hooks .calculateRoutes
119119 .promise (source, target, routesList)
120- .then ((res ) => {
120+ .then ((res ) =>
121121 // res is undefined for AsyncParallelHook
122- return routesList .getRoutes ();
123- } );
122+ routesList .getRoutes ()
123+ );
124124 }
125125
126126 useNavigationSystemAsync (source , target , callback ) {
0 commit comments