Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.7.2]

- Remove `_isSuccessfullyCompleted` and `wrapReduce` from `Action` class

## [4.7.1]

- Change `FutureOr<T?> wrapReduce(Reducer<T> reduce)` to `Future<T?> wrapReduce(Reducer<T> reduce)` to fix the issue
Expand Down
14 changes: 3 additions & 11 deletions lib/src/components/action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ abstract class Action<T extends GlobalState> extends ReduxAction<T> {
/// [OperationState.refreshing].
final bool isRefreshing;

bool _isSuccessfullyCompleted = false;

/// Returns an [operationKey]
///
/// Default: `null`.
Expand All @@ -36,14 +34,6 @@ abstract class Action<T extends GlobalState> extends ReduxAction<T> {
));
}

@override
Future<T?> wrapReduce(Reducer<T> reduce) async {
final newState = await reduce();
_isSuccessfullyCompleted = true;

return newState;
}

/// Calls parent callback [ReduxAction.after]
///
/// As the side effect - it calls [SetOperationStateAction] with
Expand All @@ -55,7 +45,9 @@ abstract class Action<T extends GlobalState> extends ReduxAction<T> {

dispatch(SetOperationStateAction<T>(
operationKey,
_isSuccessfullyCompleted ? OperationState.success : OperationState.error,
status.originalError == null && status.wrappedError == null
? OperationState.success
: OperationState.error,
));
}

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: 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:
Expand Down