copyWith method

StructuredState<TState, TEvent> copyWith({
  1. TState? state,
  2. TEvent? lastEvent,
  3. DateTime? timestamp,
  4. List<TEvent>? eventHistory,
})

Implementation

StructuredState<TState, TEvent> copyWith({
  TState? state,
  TEvent? lastEvent,
  DateTime? timestamp,
  List<TEvent>? eventHistory,
}) {
  return StructuredState<TState, TEvent>(
    state: state ?? this.state,
    lastEvent: lastEvent ?? this.lastEvent,
    timestamp: timestamp ?? this.timestamp,
    eventHistory: eventHistory ?? this.eventHistory,
  );
}