recordedEntityEvents<T extends BlocxBaseEntity> method
All recorded entity command events targeting entity type T.
Implementation
List<BlocxEntityEvent<T>> recordedEntityEvents<T extends BlocxBaseEntity>() =>
List.unmodifiable(
_recordedEvents
.whereType<BlocxEntityEvent>()
.where((e) => e.entities.any((item) => item is T))
.map(
(e) => BlocxEntityEvent<T>(
id: e.id,
command: e.command,
origin: e.origin,
entities: e.entities.whereType<T>().toList(),
createdAt: e.createdAt,
),
),
);