Skip to content

Commit

Permalink
chore: removed redundant export in docs (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamorosi authored Aug 18, 2022
1 parent 8d0c2a1 commit 46dea7c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/core/tracer.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ You can quickly start by importing the `Tracer` class, initialize it outside the
}
}
export const handlerClass = new Lambda();
const handlerClass = new Lambda();
export const handler = handlerClass.handler.bind(handlerClass); // (1)
```

Expand Down Expand Up @@ -255,8 +255,8 @@ You can trace other Class methods using the `captureMethod` decorator or any arb
}
}
export const myFunction = new Lambda();
export const handler = myFunction.handler.bind(myFunction); // (1)
const handlerClass = new Lambda();
export const handler = myFunction.handler.bind(handlerClass); // (1)
```

1. Binding your handler method allows your handler to access `this`.
Expand Down
9 changes: 4 additions & 5 deletions packages/tracer/src/Tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import { Segment, Subsegment } from 'aws-xray-sdk-core';
* }
* }
*
* export const handlerClass = new Lambda();
* const handlerClass = new Lambda();
* export const handler = handlerClass.handler.bind(handlerClass);
* ```
*
Expand Down Expand Up @@ -333,7 +333,7 @@ class Tracer extends Utility implements TracerInterface {
* }
* }
*
* export const handlerClass = new Lambda();
* const handlerClass = new Lambda();
* export const handler = handlerClass.handler.bind(handlerClass);
* ```
*
Expand Down Expand Up @@ -410,9 +410,8 @@ class Tracer extends Utility implements TracerInterface {
* }
* }
*
* export const handlerClass = new Lambda();
* export const myMethod = handlerClass.myMethod;
* export const handler = handlerClass.handler;
* const handlerClass = new Lambda();
* export const handler = handlerClass.handler.bind(handlerClass);;
* ```
*
* @decorator Class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ export class MyFunctionWithDecorator {
}
}

export const handlerClass = new MyFunctionWithDecorator();
const handlerClass = new MyFunctionWithDecorator();
export const handler = handlerClass.handler.bind(handlerClass);
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ export class MyFunctionWithDecorator {
}
}

export const handlerClass = new MyFunctionWithDecorator();
const handlerClass = new MyFunctionWithDecorator();
export const handler = handlerClass.handler.bind(handlerClass);

0 comments on commit 46dea7c

Please sign in to comment.