You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loading is a state, not a result. Result means an outcome. Something's outcome is always either Success or Failure. A Failure is caused by an error (a.k.a. Throwable).
A task can be in one of the following states;
Not Started (not useful)
Ongoing/In Progress
Ended (either successfully or unsuccessfully)
A result of a task is also one of its states (Ended). Because of that, Success and Failure can easily be incorporated into TakState.
In the end, what we get is:
sealedinterfaceTaskState<outT> {
data classSuccess<T>(valdata:T) : TaskState<T>
data classFailure(valcause:Throwable) : TaskState<Nothing>
data objectOngoing : TaskState<Nothing>
}
If this is acceptable, let me know, I'll open a PR.
The text was updated successfully, but these errors were encountered:
Loading
is a state, not a result. Result means an outcome. Something's outcome is always eitherSuccess
orFailure
. AFailure
is caused by an error (a.k.a.Throwable
).A task can be in one of the following states;
A result of a task is also one of its states (Ended). Because of that,
Success
andFailure
can easily be incorporated intoTakState
.In the end, what we get is:
If this is acceptable, let me know, I'll open a PR.
The text was updated successfully, but these errors were encountered: