Skip to content

Commit

Permalink
synchronous safeCallSync method added to README
Browse files Browse the repository at this point in the history
  • Loading branch information
PfeiJit committed Oct 10, 2023
1 parent e87238a commit f7be7e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.0.0
- `safeCallSync` method added to README

## 1.0.0-rc.3
- synchronous`safeCallSync` method added for cubits

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class MyAppCubit extends SafeCubit<MyAppState> {
MyAppState Function(UnexpectedError error) get errorState => MyAppErrorState.new;
}
```

Alternatively, if your cubit method is synchronous, you can wrap it in `safeCallSync` method.
Each time an exception occurs, it is caught by the parent class and `MyAppErrorState` is emitted. This state contains an `UnexpectedError` object with additional information about the exception including the exception itself.

Both `onSafe` and `safeCall` provide a unique `trackingId` that can be used to track the user actions. Both methods also provide additional parameters:
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: safe_bloc
description: An extension to bloc state management library that manages unexpected exceptions.
version: 1.0.0-rc.3
version: 1.0.0
repository: https://github.com/netglade/safe_bloc
issue_tracker: https://github.com/netglade/safe_bloc/issues

Expand Down

0 comments on commit f7be7e7

Please sign in to comment.