DoLastWith<C extends Comp<T> > method
void
DoLastWith<C extends Comp<T> >(
- void fn(
- E entity,
- C c
Query-like Calls fn with the last matching element and its C
component. Does nothing if the result set is empty.
Implementation
void DoLastWith<
C extends Comp<T>
>(void Function(E entity, C c) fn) {
final entities = _resolve();
if (entities.isEmpty) return;
final entity = entities.last;
entity.on<C>((c) => fn(entity, c));
}