diff --git a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateExtensions.kt b/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateExtensions.kt index 1125aeed2..217610c94 100644 --- a/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateExtensions.kt +++ b/retrofit/src/main/java/com/crazylegend/retrofit/viewstate/state/ViewStateExtensions.kt @@ -124,4 +124,7 @@ fun ApiResult.asViewEvent() = when (this) { ApiResult.Idle -> ViewStatefulEvent.Idle ApiResult.Loading -> ViewStatefulEvent.Loading is ApiResult.Success -> ViewStatefulEvent.Success -} \ No newline at end of file +} + +fun ViewStateContract.startLoading() = ApiResult.Loading.asViewStatePayload(this) +suspend fun ViewStateContract.startLoadingWithEvents() = ApiResult.Loading.asViewStatePayloadWithEvents(this) \ No newline at end of file