Skip to content

Commit f502374

Browse files
committed
port setContext
1 parent 3d3dd2b commit f502374

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/hub/src/exports.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,13 @@ export function configureScope(callback: (scope: Scope) => void): ReturnType<Hub
7777
export function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadcrumb']> {
7878
return getCurrentHub().addBreadcrumb(breadcrumb);
7979
}
80+
81+
/**
82+
* Sets context data with the given name.
83+
* @param name of the context
84+
* @param context Any kind of data. This data will be normalized.
85+
*/
86+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
87+
export function setContext(name: string, context: { [key: string]: any } | null): ReturnType<Hub['setContext']> {
88+
return getCurrentHub().setContext(name, context);
89+
}

packages/minimal/src/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ function callOnHub<T>(method: string, ...args: any[]): T {
2929
throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);
3030
}
3131

32-
/**
33-
* Sets context data with the given name.
34-
* @param name of the context
35-
* @param context Any kind of data. This data will be normalized.
36-
*/
37-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
38-
export function setContext(name: string, context: { [key: string]: any } | null): void {
39-
callOnHub<void>('setContext', name, context);
40-
}
41-
4232
/**
4333
* Set an object that will be merged sent as extra data with the event.
4434
* @param extras Extras object to merge into current context.

0 commit comments

Comments
 (0)