Skip to content

Commit

Permalink
Update event_bus.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadaski authored Mar 27, 2019
1 parent d6e494a commit fd4847b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/event_bus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ class EventBus {
/// during a [fire] call. If false (the default), the event will be passed to
/// the listeners at a later time, after the code creating the event has
/// completed.
EventBus({bool sync = false})
: _streamController = StreamController.broadcast(sync: sync);

/// Also you can pass your own StreamController as EventBus to extend StreamController
/// such like Subject in RxDart.
///
EventBus({bool sync = false, StreamController controller}) {
_streamController = controller == null
? StreamController.broadcast(sync: sync)
: controller;
}
EventBus.custom(StreamController controller) : _streamController = controller;

/// Listens for events of Type [T] and its subtypes.
///
Expand Down

0 comments on commit fd4847b

Please sign in to comment.