-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Add
getGlobalScope()
method
This scope lives in module scope and is applied to _all_ events.
- Loading branch information
Showing
12 changed files
with
605 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Scope } from '@sentry/types'; | ||
|
||
interface GlobalData { | ||
globalScope?: Scope; | ||
} | ||
|
||
const GLOBAL_DATA: GlobalData = {}; | ||
|
||
/** | ||
* Get the global data. | ||
*/ | ||
export function getGlobalData(): GlobalData { | ||
return GLOBAL_DATA; | ||
} | ||
|
||
/** | ||
* Reset all global data. | ||
* Mostly useful for tests. | ||
*/ | ||
export function clearGlobalData(): void { | ||
delete GLOBAL_DATA.globalScope; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.