updater_queue_bloc 0.1.1 updater_queue_bloc: ^0.1.1 copied to clipboard
An async state queue implementation, to be used a the basis for a bloc.
updater_queue_bloc #
import 'package:updater_queue_bloc/updater_queue_bloc.dart';
class CounterBloc extends UpdaterQueue<int> {
CounterBloc() : super(0);
Future<void> increment() async {
await map((count) => count + 1);
}
Future<void> addNTimes(int n) async {
await expand(
(count) async* {
for (var i = 0; i < n; i++) {
yield count + n;
}
},
);
}
}