Skip to content

Commit 120ad0e

Browse files
committed
1.3.1
1 parent 2bcde99 commit 120ad0e

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.3.1 - Oct 6, 2020
2+
3+
- Add extension for `Iterable<Sink>` and `Iterable<StreamSubscription>`.
4+
- Update docs.
5+
16
## 1.3.0 - Sep 29, 2020
27

38
- Bugfix: `Uncaught Error: Bad state: Cannot add event after closing`.

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,44 @@ main() async {
3535
}
3636
```
3737

38+
### API
39+
40+
## 1. Add, addAll
41+
42+
```dart
43+
Future<bool> DisposeBag.add(StreamSubscription);
44+
Future<bool> DisposeBag.add(Sink);
45+
Future<bool> DisposeBag.addAll(Iterable<StreamSubscription>);
46+
Future<bool> DisposeBag.addAll(Iterable<Sink>);
47+
48+
// extension methods
49+
Future<bool> StreamSubscription.disposedBy(DisposeBag);
50+
Future<bool> Sink.disposedBy(DisposeBag);
51+
Future<bool> Iterable<StreamSubscription>.disposedBy(DisposeBag);
52+
Future<bool> Iterable<Sink>.disposedBy(DisposeBag);
53+
```
54+
55+
## 2. Delete (removes but does not dispose)
56+
57+
```dart
58+
Future<bool> delete(StreamSubscription);
59+
Future<bool> delete(Sink);
60+
```
61+
62+
## 3. Remove (removes and disposes)
63+
64+
```dart
65+
Future<bool> remove(StreamSubscription);
66+
Future<bool> remove(Sink);
67+
```
68+
69+
## 4. Clear, dispose
70+
71+
```dart
72+
Future<bool> clear();
73+
Future<bool> dispose();
74+
```
75+
3876
## Features and bugs
3977

4078
Please file feature requests and bugs at the [issue tracker][tracker].

pubspec.yaml

Lines changed: 1 addition & 1 deletion
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.3.0
3+
version: 1.3.1
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

0 commit comments

Comments
 (0)