mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
10 lines
233 B
Dart
10 lines
233 B
Dart
import 'dart:async';
|
|
|
|
Future<void> wait(
|
|
FutureOr<bool> Function() condition, {
|
|
Duration? pollInterval,
|
|
}) async {
|
|
while (!await condition()) {
|
|
await Future.delayed(pollInterval ?? const Duration(milliseconds: 500));
|
|
}
|
|
}
|