Skip to content

chore(tracer): remove redundant export in docs & examples #1062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);