ReactterAction<T> typedef
- @Deprecated('Use `RtAction` instead. ' 'This feature was deprecated after v7.3.0.')
A representation of an event that describes something that happened in the application.
A RtAction 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 RtAction might look like this:
class AddTodoAction extends RtAction<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:
- UseReducer, a RtHook that manages state using
reducer
method.
Implementation
@Deprecated(
'Use `RtAction` instead. '
'This feature was deprecated after v7.3.0.',
)
typedef ReactterAction<T> = RtAction<T>;