ReduxActions class abstract
ReduxActions is a container for all of your applications actions.
When using ReduxActions the developer does not have to instantiate their ActionDispatchers, they only need to define them.
The generator will generate a class with all of the boilerplate need to instantiate the ActionDispatchers and sync them with the redux action dispatcher.
The generator will also generate another class, ActionNames
, that contains
a static accessors for each ActionDispatcher that is typed with a generic that is the same
as the ActionDispatcher payload generic. This allows you to build reducer handlers with type
safety without having to instantiate your instance of ReduxActions.
One can also nest ReduxActions just like one can nest built_values.
Example:
The following actions
abstract class BaseActions {
ActionDispatcher<int> foo;
NestedActions nestedActions;
}
abstract class NestedActions {
ActionDispatcher<int> bar;
}
generate to
class _$BaseActions extends BaseActions {
final ActionDispatcher<int> foo = ActionDispatcher<int>('BaseActions-foo');
final NestedActions nestedActions = NestedActions();
factory _$BaseActions() => _$BaseActions._();
_$BaseActions._() : super._();
setDispatcher(dispatcher) {
foo.setDispatcher(dispatcher);
nestedActions.setDispatcher(dispatcher);
}
}
class BaseActionsNames {
static ActionName foo = ActionName<int>('BaseActions-foo');
}
class _$NestedActions extends NestedActions {
final ActionDispatcher<int> bar = ActionDispatcher<int>('NestedActions-bar');
factory _$NestedActions() => _$NestedActions._();
_$NestedActions._() : super._();
setDispatcher(dispatcher) {
bar.setDispatcher(dispatcher);
}
}
class NestedActionsNames {
static ActionName bar = ActionName<int>('NestedActions-bar');
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
-
setDispatcher(
Dispatcher dispatcher) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited