Skip to content

Commit 682b124

Browse files
committed
1.2.0
1 parent 1a2109f commit 682b124

File tree

5 files changed

+51
-20
lines changed

5 files changed

+51
-20
lines changed

.idea/workspace.xml

+26-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
## 1.2.0 - Aug 15, 2020
2+
3+
- Updated: `constructor` allow only **`Sink | StreamSubscription`** type.
4+
15
## 1.1.4 - Aug 15, 2020
26

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

lib/src/disposebag_base.dart

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class DisposeBag {
127127
this.loggerEnabled = true,
128128
this.logger = _defaultLogger,
129129
]) : assert(loggerEnabled != null) {
130+
_guardTypeMany(disposables);
130131
_resources.addAll(disposables);
131132
}
132133

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: disposebag
22
description: A package to help disposing Streams and closing Sinks easily.
3-
version: 1.1.4
3+
version: 1.2.0
44
homepage: https://github.com/hoc081098/disposebag.git
55
repository: https://github.com/hoc081098/disposebag.git
66
issue_tracker: https://github.com/hoc081098/disposebag/issues

test/disposebag_test.dart

+18
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,24 @@ void main() {
297297
throwsArgumentError,
298298
);
299299
});
300+
301+
test('DisposeBag.constructor', () {
302+
expect(
303+
() => DisposeBag([
304+
1,
305+
Stream.value(1).listen(null),
306+
]),
307+
throwsArgumentError,
308+
);
309+
310+
expect(
311+
() => DisposeBag([
312+
null,
313+
Stream.value(1).listen(null),
314+
]),
315+
throwsArgumentError,
316+
);
317+
});
300318
});
301319

302320
test('DisposeBag.disposables', () {

0 commit comments

Comments
 (0)