-
Notifications
You must be signed in to change notification settings - Fork 0
Add default values for the StreamClient factory method
#33
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
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
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.
Pull request overview
This PR simplifies the StreamClient factory method by adding default parameter values for all non-mandatory configuration options, significantly reducing boilerplate code required to instantiate the client. The changes demonstrate the improvement by replacing the verbose createStreamClient helper function with direct client instantiation using the enhanced factory method.
- Added default parameter values to the
StreamClientfactory method for subscription managers, processors, monitors, and other components - Moved client instantiation to the Application class (
SampleApp) for proper lifecycle management - Removed the now-unnecessary
createStreamClienthelper function
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| stream-android-core/src/main/java/io/getstream/android/core/api/StreamClient.kt | Added default parameter values for components that don't require explicit configuration, reorganized parameters with mandatory ones first |
| app/src/main/java/io/getstream/android/core/sample/client/StreamClient.kt | Removed the entire createStreamClient helper function (158 lines) as it's no longer needed |
| app/src/main/java/io/getstream/android/core/sample/SampleApp.kt | New Application class that creates and holds the StreamClient instance using the simplified factory method |
| app/src/main/java/io/getstream/android/core/sample/SampleActivity.kt | Updated to retrieve StreamClient from SampleApp instead of creating it locally, added onDestroy cleanup |
| app/src/main/AndroidManifest.xml | Registered SampleApp as the application class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/src/main/java/io/getstream/android/core/sample/SampleApp.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/getstream/android/core/sample/SampleApp.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/getstream/android/core/sample/SampleApp.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/getstream/android/core/sample/SampleApp.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/getstream/android/core/sample/SampleActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/io/getstream/android/core/sample/SampleApp.kt
Outdated
Show resolved
Hide resolved
|
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.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Goal
Easier instance creation of the client.
Implementation
In the
StreamClientfactory method, we've now added sensible defaults to everything that is not mandatory to configure by the product.Testing
Build core locally and check if you can remove the big chunk of creation logic there is in feeds. :)
Checklist