Skip to content

Commit

Permalink
Cleanup and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
marcojakob committed Feb 13, 2019
1 parent c21526a commit 35e89e3
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 47 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 1.0.2 (2019-02-14)

- Cleanup and update dependencies.

## Version 1.0.0 (2018-07-06)

- Migrate to Dart 2.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ eventBus.fire(new UserLoggedInEvent(myUser));

## Running / Building / Testing

- Run from the terminal: `pub run build_runner serve`
- Build from the terminal: `pub run build_runner build --config release --output build`
- Testing: `pub run build_runner test --fail-on-severe -- -p chrome`
- Run from the terminal: `webdev serve`
- Build from the terminal: `webdev build`
- Testing: `pub run build_runner test -- -p chrome`

## License

Expand Down
10 changes: 0 additions & 10 deletions analysis_options.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions build.debug.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions build.release.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/event_bus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EventBus {
/// the listeners at a later time, after the code creating the event has
/// completed.
///
EventBus({bool sync: false}) {
EventBus({bool sync = false}) {
_streamController = new StreamController.broadcast(sync: sync);
}

Expand Down
15 changes: 8 additions & 7 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: event_bus
version: 1.0.1
version: 1.0.2
author: Marco Jakob <[email protected]>
description: A simple Event Bus using Dart Streams for decoupling applications
homepage: http://code.makery.ch/library/dart-event-bus
repository:
homepage: https://code.makery.ch/library/dart-event-bus
environment:
sdk: '>=2.0.0-dev.58.0 <3.0.0'
sdk: '>=2.0.0 <3.0.0'
dev_dependencies:
build_runner: ^0.9.1
build_web_compilers: ^0.4.0
build_test: ^0.10.2
build_runner: ^1.2.5
build_web_compilers: ^1.1.0
build_test: ^0.10.3
logging: ^0.11.0
test: ^1.2.0
test: ^1.5.0
21 changes: 21 additions & 0 deletions test/event_bus_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class EventB {
EventB(this.text);
}

class EventWithMap {
Map myMap;

EventWithMap(this.myMap);
}

main() {
group('[EventBus]', () {
test('Fire one event', () {
Expand Down Expand Up @@ -86,5 +92,20 @@ main() {
expect(events.length, 3);
});
});

test('Fire event with a map type', () {
// given
EventBus eventBus = new EventBus();
Future f = eventBus.on<EventWithMap>().toList();

// when
eventBus.fire(new EventWithMap({'a': 'test'}));
eventBus.destroy();

// then
return f.then((events) {
expect(events.length, 1);
});
});
});
}

0 comments on commit 35e89e3

Please sign in to comment.