Skip to content

Commit

Permalink
Merge pull request #1102 from nextcloud/refactor/neon/interactivebloc…
Browse files Browse the repository at this point in the history
…_wrap_action_name

refactor(neon): rename action parameter of InteractiveBloc.wrapAction
  • Loading branch information
Leptopoda authored Nov 3, 2023
2 parents 9bc1ebe + 9253dd4 commit 4643f1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/neon/neon/lib/src/bloc/bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract class InteractiveBloc extends Bloc {
_errorsStreamController.add(error);
}

/// Wraps the action [call].
/// Wraps the given [action].
///
/// If [disableTimeout] is `true` [RequestManager] will apply the default
/// timeout. On success the state will be refreshed through the [refresh]
Expand All @@ -52,15 +52,15 @@ abstract class InteractiveBloc extends Bloc {
@protected
// ignore: avoid_void_async
void wrapAction(
final AsyncCallback call, {
final AsyncCallback action, {
final bool disableTimeout = false,
final AsyncCallback? refresh,
}) async {
try {
if (disableTimeout) {
await call();
await action();
} else {
await RequestManager.instance.timeout(call);
await RequestManager.instance.timeout(action);
}

await (refresh ?? this.refresh)();
Expand Down

0 comments on commit 4643f1f

Please sign in to comment.