Re-architecturing library #14
Replies: 3 comments 7 replies
-
Sounds good to me, first of all. Additionally I have over plans. I'm trying more and more to shift from pure Android to as much Kotlin Multiplatform as possible. My (thought of) goal of this re-architecture is NOT to completly shift it over to Kotlin Multiplatform with this library, instead more like make it compatible with it.
I have experience with Kotlin Multiplatform projects, so I'm available to help and do this migration. My plan would be as follows:
|
Beta Was this translation helpful? Give feedback.
-
As we change the networkRequest type from There might be use cases (e.g. doing and handling requests yourself) the For the meantime I would like to introduce another function, so well call the "main" one (ApiResponse<*>) |
Beta Was this translation helpful? Give feedback.
-
@DatL4g I would like to understand more about "doing and handling requests yourself" and how "Stabilize overload resolution by lambda return type" can help in this situation. |
Beta Was this translation helpful? Give feedback.
-
I've been thinking to re-architecture flower library to prepare it for modern requirements and better code quality and maintainability.
I'm planning to work on following features.
data class
forSuccess
andError
instead ofenum class
as aStatus
ofResource
class to provide correct information in resource statusnetworkBoundResource
function todbBoundResource
as we have a separate function callednetworkResource
specifically for network requests.fetchFromRemote
function tomakeNetworkRequest
asfetchFromRemote
is not ideal name when we're making network request to upload data, or callingPOST
/PATCH
API.shouldFetchFromRemote
function toshouldMakeNetworkRequest
for similar reason.ApiResponse<REMOTE>
return type instead ofFlow<ApiResponse<REMOTE>>
infetchFromRemote
function as I'm not seeing much benefit of usingFlow
for network request (Not sure if this would be possible).These are few things I've in my minds. Of course, it's not final and i welcome all the suggestions and contributions. You can also provide more features/changes if you've them.
Beta Was this translation helpful? Give feedback.
All reactions