-
Notifications
You must be signed in to change notification settings - Fork 53
[CHORE/FIX] [V3] Refactor modules to use Singleton Global Instance #1072
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
[CHORE/FIX] [V3] Refactor modules to use Singleton Global Instance #1072
Conversation
3f8827b to
8210b19
Compare
sbarrio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel safer already 👌
3e0c785 to
bfdb696
Compare
The base branch was changed.
* Fixes an issue that happens consistently on Expo, where the import duplicates the isInitialized state variable, preventing the SDK to be correctly attached to the native implementation
13370e3 to
705b2e9
Compare
* Solves an issue where the config object is duplicated for multiple imports leading to incorrect state management, and interaction tracking being disabled
705b2e9 to
06b6ddc
Compare
| }); | ||
|
|
||
| it('does nothing when startTrackingViews { undefined any ', async () => { | ||
| it('does nothing when startTrackingViews { undefined any }', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops. Thanks 🙇
| }; | ||
| } | ||
|
|
||
| export const DdRumReactNavigationTracking = getGlobalInstance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing this, I think we should do the same for DdRumReactNativeNavigationTracking.tsx (on this or on a separate PR).
| this.paramsTrackingPredicate = defaultParamsPredicate; | ||
| this.viewNamePredicate = defaultViewNamePredicate; | ||
| this.viewTrackingPredicate = defaultViewTrackingPredicate; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much cleaner ❤️
What does this PR do?
Refactors relevant modules to use the
getGlobalInstance()singleton pattern.Motivation
Prevents problems caused by static properties having different values when imported from multiple sources.
Review checklist (to be filled by reviewers)