Store<Error extends Object, State extends Object> class
abstract
Constructors
-
Store(State initialState)
-
initialState
Start this store with a value defalt.
Methods
-
destroy()
→ Future
-
Discard the store
-
execute(Future<State> func(), {Duration delay = const Duration(milliseconds: 50)})
→ Future<void>
-
Execute a Future.
-
executeEither(Future<EitherAdapter<Error, State>> func(), {Duration delay = const Duration(milliseconds: 50)})
→ Future<void>
-
Execute a Future Either
dartz
.
-
executeStream(Stream<State> stream)
→ StreamSubscription
-
Execute a Stream.
-
initStore()
→ void
-
-
middleware(Triple<Error, State> newTriple)
→ Triple<Error, State>
-
called when dispacher update, setLoading or setError
overriding to change triple before the propagation;
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
observer({void onState(State state)?, void onLoading(bool isLoading)?, void onError(Error error)?})
→ Disposer
-
Observer the Segmented State.
-
propagate(Triple<Error, State> triple)
→ void
-
IMPORTANT!!!
THIS METHOD TO BE VISIBLE FOR OVERRIDING ONLY!!!
-
setError(Error newError, {bool force = false})
→ void
-
Change the error value.
-
setLoading(bool newloading, {bool force = false})
→ void
-
Change the loading value.
-
toString()
→ String
-
A string representation of this object.
inherited
-
update(State newState, {bool force = false})
→ void
-
Change the State value.
-
when<TReturn>({required TReturn onState(State state), TReturn onLoading(bool isLoading)?, TReturn onError(Error error)?})
→ TReturn
-
Represents a value of one of three mapped possibilities.