ReduxActions class

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 = new ActionDispatcher<int>('BaseActions-foo');
  final NestedActions nestedActions = new NestedActions();

  factory _$BaseActions() => new _$BaseActions._();
  _$BaseActions._() : super._();

  setDispatcher(dispatcher) {
    foo.setDispatcher(dispatcher);
    nestedActions.setDispatcher(dispatcher);
  }
}

 class BaseActionsNames {
  static ActionName foo = new ActionName<int>('BaseActions-foo');
}

class _$NestedActions extends NestedActions {
  final ActionDispatcher<int> bar = new ActionDispatcher<int>('NestedActions-bar');

  factory _$NestedActions() => new _$NestedActions._();
  _$NestedActions._() : super._();

  setDispatcher(dispatcher) {
    bar.setDispatcher(dispatcher);
  }
}

 class NestedActionsNames {
  static ActionName bar = new ActionName<int>('NestedActions-bar');
}

Constructors

ReduxActions()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

setDispatcher(Dispatcher dispatcher) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited