cake_wallet/lib/core/transaction_history.dart
2020-06-01 21:13:56 +03:00

27 lines
No EOL
528 B
Dart

import 'package:mobx/mobx.dart';
abstract class TranasctionHistoryBase<TransactionType> {
TranasctionHistoryBase() : _isUpdating = false;
@observable
List<TransactionType> transactions;
bool _isUpdating;
Future<void> update() async {
if (_isUpdating) {
return;
}
try {
_isUpdating = false;
transactions = await fetchTransactions();
_isUpdating = true;
} catch (e) {
_isUpdating = false;
rethrow;
}
}
Future<List<TransactionType>> fetchTransactions();
}