debugEntityUpdate method

  1. @visibleForTesting
EntityFake debugEntityUpdate(
  1. EntityFake update(
    1. EntityFake
    )
)
inherited

A development-only way to update entity outside of UseCase.

Implementation

@visibleForTesting

/// A development-only way to update [entity] outside of [UseCase].
E debugEntityUpdate(E Function(E) update) {
  late E updatedEntity;
  assert(
    () {
      updatedEntity = entity = update(super.state);
      return true;
    }(),
    '',
  );
  return updatedEntity;
}