mirror of https://github.com/AMT-Cheif/drift.git
Avoid overly careful runZoneGuarded
This commit is contained in:
parent
9af708773c
commit
a8d57515c3
|
@ -41,6 +41,7 @@ dev_dependencies:
|
||||||
drift_dev:
|
drift_dev:
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
|
# Waiting for dartdoc, https://github.com/dart-lang/dartdoc/pull/3033
|
||||||
analyzer: ^4.0.0
|
analyzer: ^4.0.0
|
||||||
moor:
|
moor:
|
||||||
path: ../moor
|
path: ../moor
|
||||||
|
|
|
@ -12,9 +12,8 @@ CancellationToken<T> runCancellable<T>(
|
||||||
Future<T> Function() operation,
|
Future<T> Function() operation,
|
||||||
) {
|
) {
|
||||||
final token = CancellationToken<T>();
|
final token = CancellationToken<T>();
|
||||||
runZonedGuarded(
|
runZoned(
|
||||||
() => operation().then(token._resultCompleter.complete),
|
() => token._resultCompleter.complete(Future.sync(operation)),
|
||||||
token._resultCompleter.completeError,
|
|
||||||
zoneValues: {_key: token},
|
zoneValues: {_key: token},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue