perform method
The business logic implementation.
Called by execute. Throw freely — exceptions are caught and converted to BlocxUseCaseFailure automatically.
Return values via success:
return success(myOutput);
Implementation
@override
Future<BlocxUseCaseResult<BlocxPage<T>>> perform(
BlocxCursorPaginatedInput input,
) async {
recordedInputs.add(input);
if (delay > Duration.zero) await Future<void>.delayed(delay);
if (completer != null) await completer!.future;
if (shouldFail) {
throw failureError ?? Exception('Cursor paginated task failed');
}
final page = source.getCursorPage(cursor: input.cursor, limit: input.limit);
return success(page);
}