Skip to content

Commit e44b259

Browse files
committed
port setTag
1 parent 03d08b0 commit e44b259

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

packages/hub/src/exports.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,15 @@ export function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']>
112112
export function setTags(tags: { [key: string]: Primitive }): ReturnType<Hub['setTags']> {
113113
getCurrentHub().setTags(tags);
114114
}
115+
116+
/**
117+
* Set key:value that will be sent as tags data with the event.
118+
*
119+
* Can also be used to unset a tag, by passing `undefined`.
120+
*
121+
* @param key String key of tag
122+
* @param value Value of tag
123+
*/
124+
export function setTag(key: string, value: Primitive): ReturnType<Hub['setTag']> {
125+
getCurrentHub().setTag(key, value);
126+
}

packages/minimal/src/index.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +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-
* Set key:value that will be sent as tags data with the event.
34-
*
35-
* Can also be used to unset a tag, by passing `undefined`.
36-
*
37-
* @param key String key of tag
38-
* @param value Value of tag
39-
*/
40-
export function setTag(key: string, value: Primitive): void {
41-
callOnHub<void>('setTag', key, value);
42-
}
43-
4432
/**
4533
* Updates user context information for future events.
4634
*

0 commit comments

Comments
 (0)