-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add SdkComponent and move configuration fetch out of BraintreeClient #1203
Conversation
…es that require context to a SdkComponent singleton
integration | ||
) | ||
fun sendEvent(event: AnalyticsEvent) { | ||
configurationLoader.loadConfiguration { result -> |
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.
Added the fetching of Configuration here
…nt and ConfigurationLoader
* Returns the instance of [SdkComponent] | ||
*/ | ||
fun getInstance(): SdkComponent { | ||
return checkNotNull(instance) |
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.
If this ever is null what happens at that point?
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.
It would throw an IllegalStateException
. However this should never happen since create()
would be called before getInstance()
, which would set the singleton instance.
Summary of changes
ConfigurationLoaderResult
to make it easier to handleConfigurationLoaderCallback.onResult()
AnalyticsClient
Checklist
Authors