Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 committed Aug 15, 2020
1 parent 1a2109f commit 682b124
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 20 deletions.
44 changes: 26 additions & 18 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 1.2.0 - Aug 15, 2020

- Updated: `constructor` allow only **`Sink | StreamSubscription`** type.

## 1.1.4 - Aug 15, 2020

- Updated: methods `add`, `addAll`, `remove`, `delete`, `constructor` allow only **`Sink | StreamSubscription`** type.
- Updated: methods `add`, `addAll`, `remove` and `delete` allow only **`Sink | StreamSubscription`** type.
- Updated: internal implementation.
- Fixed: default logger logs `error` and `StackTrace` to console, before missing.

Expand Down
1 change: 1 addition & 0 deletions lib/src/disposebag_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class DisposeBag {
this.loggerEnabled = true,
this.logger = _defaultLogger,
]) : assert(loggerEnabled != null) {
_guardTypeMany(disposables);
_resources.addAll(disposables);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: disposebag
description: A package to help disposing Streams and closing Sinks easily.
version: 1.1.4
version: 1.2.0
homepage: https://github.com/hoc081098/disposebag.git
repository: https://github.com/hoc081098/disposebag.git
issue_tracker: https://github.com/hoc081098/disposebag/issues
Expand Down
18 changes: 18 additions & 0 deletions test/disposebag_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,24 @@ void main() {
throwsArgumentError,
);
});

test('DisposeBag.constructor', () {
expect(
() => DisposeBag([
1,
Stream.value(1).listen(null),
]),
throwsArgumentError,
);

expect(
() => DisposeBag([
null,
Stream.value(1).listen(null),
]),
throwsArgumentError,
);
});
});

test('DisposeBag.disposables', () {
Expand Down

0 comments on commit 682b124

Please sign in to comment.