ReactterAction<T> class

A representation of an event that describes something that happened in the application.

A ReactterAction is composed of two properties:

  • The type property, which provides this action a name that is descriptive.
  • The payload property, which contain an action object type of T that can provide additional information about what happened.

A typical ReactterAction might look like this:

class AddTodoAction extends ReactterAction<String> {
  AddTodoAction(String payload)
    : super(
        type: 'todo/todoAdded',
        payload: payload,
      );
}

and use with UseReducer dispatch, like:

// Consult `UseReducer` for more information about `reducer` and `store`.
final state = UseReducer(reducer, store);
state.dispatch(AddTodoAction('Todo this'));

See also:

Implementers

Constructors

ReactterAction({required String type, required T payload})
A representation of an event that describes something that happened in the application.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
payload → T
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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