Network State
NetworkState
is a structure to handle the different network states.
The NetworkState
structure has 3 different states
NetworkState.Loading
: Indicate that a service call is running.NetworkState.Loaded
: Indicate that a service call executed successfully.NetworkState.Error
: Indicate that a service call failed.
Each state provides some information related the performed request:
page
: The requested page number.pageSize
: The requested page size.isFirstPage
: Indicates if the requested page is the first page.isLastPage
: Indicates if the requested page is the last page.
The NetworkState.Error
class provides an additional field including the Throwable that caused the error.
Last updated