define<TValue extends Object, TState extends AggregateState<TValue>> static method

void define<TValue extends Object, TState extends AggregateState<TValue>>(
  1. AggregateStateCreator<TValue, TState> creator, {
  2. String? name,
})

Implementation

static void
    define<TValue extends Object, TState extends AggregateState<TValue>>(
  AggregateStateCreator<TValue, TState> creator, {
  String? name,
}) {
  final type = typeOf<TState>();
  final actual = name ?? type.toString();
  if (!containsTypeName(actual)) {
    _reverseMap[actual] = type;
    _map[type] = actual;
    _creators[type] = creator;
  }
}