-
Notifications
You must be signed in to change notification settings - Fork 0
Review #9
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
base: comment
Are you sure you want to change the base?
Conversation
Implementing UsersNetworkDataSource using Ktor as http client. Json parsing is done by Kotlinx serialization. Parsing tests were added in UsersApiTest.
This is necessary to not be warned about using @Incubating features.
UsersRepository is implemented by NetworkUsersRepository, which is using only one DataSource - UsersNetworkDataSource. Test were added in NetworkUsersRepositoryTest.
UI State is represented by class UserListUiState. Tests were implemented in UserListViewModelTest.
Added Koin modules for data:users:network, data:users:repository and ui:userlist. In :app module DI was configured using cokoin and WithDependencyInjection Composable function.
As this module includes :data:users:model via api() I think it's better to call it :core than :repository.
…dule I plan to use FakeUsersRepository and TestUsers in :ui:userdetails - extracting to separate module will help me reuse it there.
Next version - contains error handling, pagination and Compose Multiplatform
Update dependency com.alialbaali.kamel:kamel-image to v0.4.1
Update dependency gradle to v7.6
app/android/src/androidTest/kotlin/dev/burnoo/demo/listapp/AndroidAppTest.kt
Show resolved
Hide resolved
.../compose-utils/src/commonMain/kotlin/dev/burnoo/demo/listapp/core/compose/utils/di/Module.kt
Show resolved
Hide resolved
...est/src/commonMain/kotlin/dev/burnoo/demo/listapp/data/users/network/test/GetUserResponse.kt
Show resolved
Hide resolved
...ers/network/src/commonMain/kotlin/dev/burnoo/demo/listapp/data/users/network/api/UsersApi.kt
Show resolved
Hide resolved
| package dev.burnoo.demo.listapp.data.users.network.model | ||
|
|
||
| enum class NetworkError { | ||
| Client, Server, Device |
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.
What's the difference between client and device here?
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.
Client -> 4xx
Device -> No Internet, etc.
I will think about better naming
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.
Device -> Network maybe? I'd expect IOException or `SocketTimeoutException or similar, don't know about others.
PR for CR, comments are welcome 🕵️