Skip to content

Commit

Permalink
sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroMaglione committed Apr 9, 2024
1 parent 4039939 commit 29331c8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/fpdart/lib/src/effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:async';
import 'package:fpdart/fpdart.dart';

import './extension/future_or_extension.dart';
import './extension/iterable_extension.dart';
import 'unit.dart' as fpdart_unit;

part 'async_context.dart';
Expand Down Expand Up @@ -206,15 +205,10 @@ final class Effect<E, L, R> extends IEffect<E, L, R> {
resume.succeed(null);
});

if (resume._deferred.unsafeCompleted) {
return Effect.succeedLazy(() {
timer.cancel();
return resume._deferred.wait<Null>().match(
onFailure: (_) => fpdart_unit.unit,
onSuccess: (_) => fpdart_unit.unit,
);
}

return Effect.unit();
return fpdart_unit.unit;
});
},
);

Expand Down

0 comments on commit 29331c8

Please sign in to comment.