Commit 447da02 1 parent 8e20a1a commit 447da02 Copy full SHA for 447da02
File tree 4 files changed +17
-5
lines changed
4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Version 0.4.1 (2015-05-13)
4
+
5
+ * Fix Issue #13 : Improve on() stream when no type is specified
6
+
7
+
3
8
## Version 0.4.0 (2015-05-03)
4
9
5
10
* BREAKING CHANGE: Moved the ` HierarchicalEventBus ` to a separate library to
Original file line number Diff line number Diff line change @@ -45,8 +45,11 @@ class EventBus {
45
45
* subscribe again (avoids memory leak).
46
46
*/
47
47
Stream on ([Type eventType]) {
48
- return streamController.stream.where ((event) => eventType == null ||
49
- event.runtimeType == eventType);
48
+ if (eventType == null ) {
49
+ return streamController.stream;
50
+ } else {
51
+ return streamController.stream.where ((event) => event.runtimeType == eventType);
52
+ }
50
53
}
51
54
52
55
/**
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ class HierarchicalEventBus extends EventBus {
40
40
* subscribe again (avoids memory leak).
41
41
*/
42
42
Stream on ([Type eventType]) {
43
- return streamController.stream.where ((event) => eventType == null ||
44
- reflect (event).type.isSubclassOf (reflectClass (eventType)));
43
+ if (eventType == null ) {
44
+ return streamController.stream;
45
+ } else {
46
+ return streamController.stream.where ((event) =>
47
+ reflect (event).type.isSubclassOf (reflectClass (eventType)));
48
+ }
45
49
}
46
50
}
Original file line number Diff line number Diff line change 1
1
name : event_bus
2
- version : 0.4.0
2
+ version : 0.4.1
3
3
author : Marco Jakob <majakob@gmx.ch>
4
4
description : A simple Event Bus using Dart Streams for decoupling applications
5
5
homepage : http://code.makery.ch/library/dart-event-bus
You can’t perform that action at this time.
0 commit comments