Browse Source

Merge pull request #1102 from nextcloud/refactor/neon/interactivebloc_wrap_action_name

refactor(neon): rename action parameter of InteractiveBloc.wrapAction
pull/1105/head
Nikolas Rimikis 1 year ago committed by GitHub
parent
commit
4643f1f394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/neon/neon/lib/src/bloc/bloc.dart

8
packages/neon/neon/lib/src/bloc/bloc.dart

@ -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]
@ -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)();

Loading…
Cancel
Save