Browse Source

refactor(neon): rename action parameter of InteractiveBloc.wrapAction

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/1102/head
Nikolas Rimikis 1 year ago
parent
commit
9253dd48af
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  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