diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b0d361..1b8abb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [4.7.2] + +- Remove `_isSuccessfullyCompleted` and `wrapReduce` from `Action` class + ## [4.7.1] - Change `FutureOr wrapReduce(Reducer reduce)` to `Future wrapReduce(Reducer reduce)` to fix the issue diff --git a/lib/src/components/action.dart b/lib/src/components/action.dart index 110dfe2..e9b1f64 100644 --- a/lib/src/components/action.dart +++ b/lib/src/components/action.dart @@ -13,8 +13,6 @@ abstract class Action extends ReduxAction { /// [OperationState.refreshing]. final bool isRefreshing; - bool _isSuccessfullyCompleted = false; - /// Returns an [operationKey] /// /// Default: `null`. @@ -36,14 +34,6 @@ abstract class Action extends ReduxAction { )); } - @override - Future wrapReduce(Reducer reduce) async { - final newState = await reduce(); - _isSuccessfullyCompleted = true; - - return newState; - } - /// Calls parent callback [ReduxAction.after] /// /// As the side effect - it calls [SetOperationStateAction] with @@ -55,7 +45,9 @@ abstract class Action extends ReduxAction { dispatch(SetOperationStateAction( operationKey, - _isSuccessfullyCompleted ? OperationState.success : OperationState.error, + status.originalError == null && status.wrappedError == null + ? OperationState.success + : OperationState.error, )); } diff --git a/pubspec.yaml b/pubspec.yaml index 4133edc..9cf9e21 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dash_kit_core description: The core component for DashKit that provides basic architecture components -version: 4.7.1 +version: 4.7.2 homepage: https://github.com/Dash-Kit/dash-kit-core environment: