LceTerminated<DATA extends Object> class
A special state that may be used to terminate state emission in cases we always need a latest state to proceed
For example we have a view that subscribes to LceState for a resource identified with some PARAMS.
Than a delete operation is performed on that resource and it is not available anymore.
The one may emit LceTerminated to do a special processing (e.g. close the corresponding view) instead of
doing it through server request that will return a Not found
error and doing a special case
processing afterwards.
Also useful when onComplete
from state-emitter can't be processed by the end-subscriber. For example LiveData
does not emit completion and caches the latest emission. So converting stream to LiveData will loose Rx completion
logic.
- Inheritance
- Available extensions
Constructors
- LceTerminated()
-
Flow terminated state
const
Properties
- data → DATA?
-
State data
final
- dataIsValid → bool
-
A property that is evaluated internally and may mean that data being emitted is stall,
invalidated or otherwise 'not-so-valid' until some further emission (say after network
reload).
finalinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toError(
Exception error) → LceError< DATA> -
Transfers to LceError state with
error
preserving datainherited -
toLoading(
[LoadingType type = LoadingType.loading]) → LceLoading< DATA> -
Transfers to LceLoading state with loading
type
preserving datainherited -
toString(
) → String -
A string representation of this object.
override
-
when<
T extends Object> ({required T loading(LceLoading< DATA> state), required T content(LceContent<DATA> state), required T error(LceError<DATA> state), T terminated()?}) → T -
Emulates sealed class with every state callback required except
terminated
. Override it if you expect termination or leave empty to throw exceptionoverride -
whenElse<
T extends Object> ({T loading(LceLoading< DATA> state)?, T content(LceContent<DATA> state)?, T error(LceError<DATA> state)?, T terminated()?, required T onElse(LceState<DATA> state)}) → T -
Emulates sealed class with only one
onElse
callback required. Every unset callback will be routed toonElse
case.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override