Commit e34b9633 authored by Tim Smart's avatar Tim Smart

3.0.0+1

parent 13913018
## 3.0.0+1
- Update examples
## 3.0.0
- Switch back to original API
......
......@@ -28,9 +28,9 @@ class EventsBloc extends BlocStream<List<Event>> {
Future<void> fetch() async {
try {
final events = await repository.list();
subject.add(events);
add(events);
} catch (err) {
subject.addError(err);
addError(err);
}
}
}
......
......@@ -5,11 +5,11 @@ class CounterBloc extends BlocStream<int> {
int get initialValue => 0;
void increment() {
subject.add(value + 1);
add(value + 1);
}
void decrement() {
subject.add(value - 1);
add(value - 1);
}
}
......@@ -17,8 +17,8 @@ class MultiplicationBloc extends BlocStream<int> {
MultiplicationBloc(CounterBloc counter) : _counter = counter {
// Bloc has a helper method for cleaning up subscriptions without having to
// write a boilerplate close() override.
cancelOnClose(counter.stream.distinct().listen((count) {
subject.add(_multiply(count));
cancelOnClose(counter.distinct().listen((count) {
add(_multiply(count));
}));
}
......@@ -49,8 +49,8 @@ void main() {
// 1
// MULTIPLY 6
// MULTIPLY 3
counter.stream.distinct().listen(print);
multiplier.stream.distinct().listen((i) => print('MULTIPLY $i'));
counter.distinct().listen(print);
multiplier.distinct().listen((i) => print('MULTIPLY $i'));
counter.increment();
counter.increment();
......
name: bloc_stream
description: A simple package that helps you to implement the BLoC pattern in your applications.
version: 3.0.0
version: 3.0.0+1
homepage: https://gitlab.com/arisechurch/bloc_stream
environment:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment