ReduxStore<T> class
Store with Redux-like reducer pattern
- Inheritance
-
- Object
- ChangeNotifier
- Rx<
T> - ReduxStore
- Available extensions
Constructors
-
ReduxStore(T initialState, Reducer<
T> _reducer, {String? name})
Properties
-
actionHistory
→ List<
Action> -
Get action history
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- rawValue → T
-
Gets the value without registering as dependency (for internal use)
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → T
-
Get current state (alias for value)
no setter
- value ↔ T
-
Gets the current value and registers this SwiftValue as a dependency
getter/setter pairinherited
Methods
-
add(
int value) → void -
Available on Rx<
Adds a value to the reactive integer and updates it.int> , provided by the RxIntExtensions extension -
add(
String value) → void -
Available on Rx<
Adds (concatenates) a string to the reactive string and updates it.String> , provided by the RxStringExtensions extension -
add(
double value) → void -
Available on Rx<
Adds a value to the reactive double and updates it.double> , provided by the RxDoubleExtensions extension -
addGST(
double percent) → void -
Available on Rx<
Adds GST to the reactive integer.int> , provided by the RxIntExtensions extension -
addGST(
double percent) → void -
Available on Rx<
Adds GST to the reactive double.double> , provided by the RxDoubleExtensions extension -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
applyPercent(
double percent) → void -
Available on Rx<
Applies a percentage to the reactive double (adds percentage).double> , provided by the RxDoubleExtensions extension -
applyPercent(
double percent) → void -
Available on Rx<
Applies a percentage to the reactive integer (adds percentage).int> , provided by the RxIntExtensions extension -
assertType(
[String? message]) → Rx< T> -
Available on Rx<
Assert type at runtimeT> , provided by the RxTypeSafety extension -
chain(
) → ReactiveChain< T> -
Available on Rx<
Create a reactive chainT> , provided by the RxTypeSafety extension -
clearHistory(
) → void - Clear action history
-
discount(
double percent) → void -
Available on Rx<
Applies a discount percentage to the reactive integer (subtracts percentage).int> , provided by the RxIntExtensions extension -
discount(
double percent) → void -
Available on Rx<
Applies a discount percentage to the reactive double (subtracts percentage).double> , provided by the RxDoubleExtensions extension -
dispatch(
Action action) → void - Dispatch an action to update state
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
mul(
double value) → void -
Available on Rx<
Multiplies the reactive double by a value and updates it.double> , provided by the RxDoubleExtensions extension -
mul(
int value) → void -
Available on Rx<
Multiplies the reactive integer by a value and updates it.int> , provided by the RxIntExtensions extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
notifyListenersTransaction(
) → void -
Available on ChangeNotifier, provided by the TransactionNotifier extension
Notifies listeners, respecting transaction context. -
removeGST(
double percent) → void -
Available on Rx<
Removes GST from the reactive double.double> , provided by the RxDoubleExtensions extension -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
T initialState) → void - Reset to initial state
-
roundTo(
int decimals) → void -
Available on Rx<
Rounds the reactive double to a specified number of decimal places.double> , provided by the RxDoubleExtensions extension -
setHistoryEnabled(
bool enabled) → void - Enable/disable action history
-
setHistoryLimit(
int limit) → void - Set history limit
-
sub(
double value) → void -
Available on Rx<
Subtracts a value from the reactive double and updates it.double> , provided by the RxDoubleExtensions extension -
sub(
int value) → void -
Available on Rx<
Subtracts a value from the reactive integer and updates it.int> , provided by the RxIntExtensions extension -
tax(
double percent) → void -
Available on Rx<
Applies a tax percentage to the reactive double (adds percentage).double> , provided by the RxDoubleExtensions extension -
tax(
double percent) → void -
Available on Rx<
Applies a tax percentage to the reactive integer (adds percentage).int> , provided by the RxIntExtensions extension -
toggle(
) → void -
Available on Rx<
Toggles the reactive boolean value.bool> , provided by the RxBoolExtensions extension -
toString(
) → String -
A string representation of this object.
inherited
-
toTyped(
) → TypedRx< T> -
Available on Rx<
Create a typed versionT> , provided by the RxTypeSafety extension -
update(
T newValue) → void -
Updates the value and notifies listeners if changed
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited