diff --git a/CHANGELOG.md b/CHANGELOG.md index db9965b..969f9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index 96fadd1..0380376 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/analysis_options.yaml b/analysis_options.yaml deleted file mode 100644 index 338ed79..0000000 --- a/analysis_options.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# Lint rules and documentation, see http://dart-lang.github.io/linter/lints -linter: - rules: - - cancel_subscriptions - - hash_and_equals - - iterable_contains_unrelated_type - - list_remove_unrelated_type - - test_types_in_equals - - unrelated_type_equality_checks - - valid_regexps diff --git a/build.debug.yaml b/build.debug.yaml deleted file mode 100644 index c6986b6..0000000 --- a/build.debug.yaml +++ /dev/null @@ -1,11 +0,0 @@ -targets: - $default: - builders: - build_web_compilers|entrypoint: - generate_for: - - example/example.dart - options: - compiler: dartdevc - dart2js_args: - - --enable-asserts - - --preview-dart-2 diff --git a/build.release.yaml b/build.release.yaml deleted file mode 100644 index 7f35f49..0000000 --- a/build.release.yaml +++ /dev/null @@ -1,15 +0,0 @@ -targets: - $default: - builders: - build_web_compilers|entrypoint: - generate_for: - - example/example.dart - options: - compiler: dart2js - dart2js_args: - - --fast-startup - - --minify - - --trust-type-annotations - # Consult https://webdev.dartlang.org/tools/dart2js#size-and-speed-options - # before enabling the following option: - # - --trust-primitives diff --git a/lib/event_bus.dart b/lib/event_bus.dart index 9ee55ce..435462c 100644 --- a/lib/event_bus.dart +++ b/lib/event_bus.dart @@ -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); } diff --git a/pubspec.yaml b/pubspec.yaml index ecfe8fa..8e06e79 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,13 +1,14 @@ name: event_bus -version: 1.0.1 +version: 1.0.2 author: Marco Jakob 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 diff --git a/test/event_bus_test.dart b/test/event_bus_test.dart index 5a10117..883295e 100644 --- a/test/event_bus_test.dart +++ b/test/event_bus_test.dart @@ -15,6 +15,12 @@ class EventB { EventB(this.text); } +class EventWithMap { + Map myMap; + + EventWithMap(this.myMap); +} + main() { group('[EventBus]', () { test('Fire one event', () { @@ -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().toList(); + + // when + eventBus.fire(new EventWithMap({'a': 'test'})); + eventBus.destroy(); + + // then + return f.then((events) { + expect(events.length, 1); + }); + }); }); }