toggle menu
network-either-kmp
0.3.0-SNAPSHOT
common
switch theme
search in API
resource-either
/
com.javiersc.resource.either
/
ResourceEither
Resource
Either
sealed
class
ResourceEither
<
out
F
,
out
S
>
Inheritors
Failure
Success
Members
Types
Companion
Link copied to clipboard
object
Companion
Failure
Link copied to clipboard
data
class
Failure
<
out
F
,
out
S
>
(
val
failure
:
F
,
val
data
:
S
?
=
null
,
val
isLoading
:
Boolean
=
false
)
:
ResourceEither
<
F
,
S
>
Success
Link copied to clipboard
data
class
Success
<
out
S
>
(
val
data
:
S
,
val
isLoading
:
Boolean
=
false
)
:
ResourceEither
<
Nothing
,
S
>
Properties
is
Loading
Link copied to clipboard
abstract
val
isLoading
:
Boolean
Functions
fold
Link copied to clipboard
inline
fun
<
A
>
fold
(
failure
:
(
ResourceEither.Failure
<
F
,
S
>
)
->
A
,
success
:
(
ResourceEither.Success
<
S
>
)
->
A
)
:
A
if
Failure
Link copied to clipboard
inline
fun
ifFailure
(
block
:
(
ResourceEither.Failure
<
F
,
S
>
)
->
Unit
)
if
Success
Link copied to clipboard
inline
fun
ifSuccess
(
block
:
(
ResourceEither.Success
<
S
>
)
->
Unit
)
is
Failure
Link copied to clipboard
fun
isFailure
(
)
:
Boolean
is
Loading
Link copied to clipboard
@
JvmName
(
name
=
"getIsLoading"
)
fun
isLoading
(
)
:
Boolean
is
Success
Link copied to clipboard
fun
isSuccess
(
)
:
Boolean
success
Data
Or
Null
Link copied to clipboard
fun
successDataOrNull
(
)
:
S
?
success
Or
Null
Link copied to clipboard
fun
successOrNull
(
)
:
ResourceSuccess
<
S
>
?
to
Either
Link copied to clipboard
inline
fun
<
L
,
R
>
toEither
(
failure
:
(
ResourceEither.Failure
<
F
,
S
>
)
->
L
,
success
:
(
ResourceEither.Success
<
S
>
)
->
R
)
:
Either
<
L
,
R
>