Skip to content

Instantly share code, notes, and snippets.

@PreyeaRegmi
Last active September 8, 2021 11:13
Show Gist options
  • Save PreyeaRegmi/ccdf53a42d03bfe753649d56a12c502d to your computer and use it in GitHub Desktop.
Save PreyeaRegmi/ccdf53a42d03bfe753649d56a12c502d to your computer and use it in GitHub Desktop.
class FetchLoanDetail extends UseCase<LoanParamRequest, LoanDetailResponse> {
final ILoanRepository _loanRepository;
FetchLoanDetail(this._loanRepository);
@override
Stream<LoanDetailResponse> buildUseCase(LoanParamRequest param) {
return _loanRepository
.getLoanFromServer(param.amount, param.time)
.asStream()
.map((loanDetailDTO) => LoanDetailResponse());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment