Tower<T extends FortState> class

Inheritance

Constructors

Tower(Reducer<T> reducer, {required T initialState, List<Middleware<T>> middleware = const [], bool syncStream = false, bool distinct = false, SerializationFunction<T>? serializer, PersistorCallBackFunction<T>? persistorCallBack})
Default Constructor
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
onChange Stream<T>
A stream that emits the current state when it changes.
no setterinherited
persistor Persistor<T>?
If defined the redux state will persist
final
persistorCallBack PersistorCallBackFunction<T>?
Only needed if persistor is defined. Runs when if the persistor loads in a state
final
reducer Reducer<T>
The Reducer for your Store. Allows you to get the current reducer or replace it with a new one if need be.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → T
Returns the current state of the app
no setterinherited

Methods

dispatch(dynamic action) → dynamic
Runs the action through all provided Middleware, then applies an action to the state using the given Reducer. Please note: Middleware can intercept actions, and can modify actions or stop them from passing through to the reducer.
inherited
initializeFromPersistor() Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
teardown() Future
Closes down the Store so it will no longer be operational. Only use this if you want to destroy the Store while your app is running. Do not use this method as a way to stop listening to onChange state changes. For that purpose, view the onChange documentation.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited