async_tools 0.1.5 async_tools: ^0.1.5 copied to clipboard
Useful data structures and tools for async/Future code
example/async_tools_example.dart
import 'package:async_tools/async_tools.dart';
Future<void> main() async {
final waitSet = WaitSet<void, void>();
for (var n = 0; n < 10; n++) {
waitSet.add((_) async => Future.delayed(Duration(seconds: n), () {
// ignore: avoid_print
print('$n');
}));
}
await waitSet();
}