Orhan Tozan
07/20/2020, 11:07 AMgetAll
on the data in the store?no
07/20/2020, 11:08 AMOrhan Tozan
07/20/2020, 11:15 AMAhmed Ibrahim
07/20/2020, 12:37 PMsealed class RequestKey {
object All : RequestKey()
}
and when you want to use the store
store.stream(StoreRequest.fresh(RequestKey.All))
Orhan Tozan
07/20/2020, 12:41 PMsealed class Response {
data class AllUsers(val users: List<User>) : Response()
data class User(val user: User) : Response()
}
val userStore: Store<RequestKey, Response>
Ahmed Ibrahim
07/20/2020, 12:46 PMList<User>
to make it simpler and handle it based on the request key that you've requested.Response
as sealed class, then you can just do a filterIsInstance<Response.AllUsers>()
to handle the all users response.Orhan Tozan
07/20/2020, 12:49 PMAhmed Ibrahim
07/20/2020, 12:52 PMOrhan Tozan
07/20/2020, 1:19 PMAhmed Ibrahim
07/20/2020, 1:41 PMtjohnn
07/20/2020, 6:13 PMOrhan Tozan
07/26/2020, 8:41 PM