Skip to content

Commit 46dea7c

Browse files
authored
chore: removed redundant export in docs (aws-powertools#1062)
1 parent 8d0c2a1 commit 46dea7c

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

Diff for: docs/core/tracer.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ You can quickly start by importing the `Tracer` class, initialize it outside the
142142
}
143143
}
144144
145-
export const handlerClass = new Lambda();
145+
const handlerClass = new Lambda();
146146
export const handler = handlerClass.handler.bind(handlerClass); // (1)
147147
```
148148

@@ -255,8 +255,8 @@ You can trace other Class methods using the `captureMethod` decorator or any arb
255255
}
256256
}
257257
258-
export const myFunction = new Lambda();
259-
export const handler = myFunction.handler.bind(myFunction); // (1)
258+
const handlerClass = new Lambda();
259+
export const handler = myFunction.handler.bind(handlerClass); // (1)
260260
```
261261

262262
1. Binding your handler method allows your handler to access `this`.

Diff for: packages/tracer/src/Tracer.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import { Segment, Subsegment } from 'aws-xray-sdk-core';
6666
* }
6767
* }
6868
*
69-
* export const handlerClass = new Lambda();
69+
* const handlerClass = new Lambda();
7070
* export const handler = handlerClass.handler.bind(handlerClass);
7171
* ```
7272
*
@@ -333,7 +333,7 @@ class Tracer extends Utility implements TracerInterface {
333333
* }
334334
* }
335335
*
336-
* export const handlerClass = new Lambda();
336+
* const handlerClass = new Lambda();
337337
* export const handler = handlerClass.handler.bind(handlerClass);
338338
* ```
339339
*
@@ -410,9 +410,8 @@ class Tracer extends Utility implements TracerInterface {
410410
* }
411411
* }
412412
*
413-
* export const handlerClass = new Lambda();
414-
* export const myMethod = handlerClass.myMethod;
415-
* export const handler = handlerClass.handler;
413+
* const handlerClass = new Lambda();
414+
* export const handler = handlerClass.handler.bind(handlerClass);;
416415
* ```
417416
*
418417
* @decorator Class

Diff for: packages/tracer/tests/e2e/allFeatures.decorator.test.functionCode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ export class MyFunctionWithDecorator {
8787
}
8888
}
8989

90-
export const handlerClass = new MyFunctionWithDecorator();
90+
const handlerClass = new MyFunctionWithDecorator();
9191
export const handler = handlerClass.handler.bind(handlerClass);

Diff for: packages/tracer/tests/e2e/asyncHandler.decorator.test.functionCode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ export class MyFunctionWithDecorator {
8282
}
8383
}
8484

85-
export const handlerClass = new MyFunctionWithDecorator();
85+
const handlerClass = new MyFunctionWithDecorator();
8686
export const handler = handlerClass.handler.bind(handlerClass);

0 commit comments

Comments
 (0)