Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
urusai88 committed Oct 14, 2024
1 parent e55788f commit 15bc13b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.1.0
- added Future<TioResponse>.map extension method

## 1.0.0+2
- update README.md

Expand Down
10 changes: 10 additions & 0 deletions lib/src/x.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:dio/dio.dart';

import 'response.dart';

extension ListX on List<dynamic> {
/// Checks every item is type of T.
bool check<T>() => every((item) => item is T);
Expand Down Expand Up @@ -46,3 +48,11 @@ extension DioX on Dio {
);
}
}

extension FutureTioResponseX<T, E> on Future<TioResponse<T, E>> {
Future<R> map<R>({
required R Function(TioSuccess<T, E> success) success,
required R Function(TioFailure<T, E> failure) failure,
}) =>
then((response) => response.map(success: success, failure: failure));
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: tio
version: 1.0.0+2
version: 1.1.0
repository: https://github.com/urusai88/tio

description: |
Expand Down

0 comments on commit 15bc13b

Please sign in to comment.