diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a19672..73302b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.3.1 - Oct 6, 2020 + +- Add extension for `Iterable` and `Iterable`. +- Update docs. + ## 1.3.0 - Sep 29, 2020 - Bugfix: `Uncaught Error: Bad state: Cannot add event after closing`. diff --git a/README.md b/README.md index 5a47dc9..7ec9f03 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,44 @@ main() async { } ``` +### API + +## 1. Add, addAll + +```dart +Future DisposeBag.add(StreamSubscription); +Future DisposeBag.add(Sink); +Future DisposeBag.addAll(Iterable); +Future DisposeBag.addAll(Iterable); + +// extension methods +Future StreamSubscription.disposedBy(DisposeBag); +Future Sink.disposedBy(DisposeBag); +Future Iterable.disposedBy(DisposeBag); +Future Iterable.disposedBy(DisposeBag); +``` + +## 2. Delete (removes but does not dispose) + +```dart +Future delete(StreamSubscription); +Future delete(Sink); +``` + +## 3. Remove (removes and disposes) + +```dart +Future remove(StreamSubscription); +Future remove(Sink); +``` + +## 4. Clear, dispose + +```dart +Future clear(); +Future dispose(); +``` + ## Features and bugs Please file feature requests and bugs at the [issue tracker][tracker]. diff --git a/pubspec.yaml b/pubspec.yaml index e44be95..c141a2a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: disposebag description: A package to help disposing Streams and closing Sinks easily. -version: 1.3.0 +version: 1.3.1 homepage: https://github.com/hoc081098/disposebag.git repository: https://github.com/hoc081098/disposebag.git issue_tracker: https://github.com/hoc081098/disposebag/issues