Skip to content

Commit

Permalink
chore: make tsdocs more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Jun 4, 2021
1 parent e15c874 commit a77713d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export abstract class AbstractAsyncHooksContextManager

abstract disable(): this;

/**
* Binds a the certain context or the active one to the target function and then returns the target
* @param context A context (span) to be bind to target
* @param target a function or event emitter. When target or one of its callbacks is called,
* the provided context will be used as the active context for the duration of the call.
*/
bind<T>(context: Context, target: T): T {
if (target instanceof EventEmitter) {
return this._bindEventEmitter(target, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ export class ZoneContextManager implements ContextManager {

/**
* Binds a the certain context or the active one to the target function and then returns the target
* @param target
* @param context A context (span) to be bind to target
* @param target a function or event emitter. When target or one of its callbacks is called,
* the provided context will be used as the active context for the duration of the call.
*/
bind<T>(context: Context, target: T | TargetWithEvents): T {
// if no specific context to propagate is given, we use the current one
Expand Down
5 changes: 3 additions & 2 deletions packages/opentelemetry-web/src/StackContextManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ export class StackContextManager implements ContextManager {

/**
* Binds a the certain context or the active one to the target function and then returns the target
* @param target
* @param context
* @param context A context (span) to be bind to target
* @param target a function or event emitter. When target or one of its callbacks is called,
* the provided context will be used as the active context for the duration of the call.
*/
bind<T>(context: Context, target: T): T {
// if no specific context to propagate is given, we use the current one
Expand Down

0 comments on commit a77713d

Please sign in to comment.