Skip to content

Commit 66c0219

Browse files
authored
Update real_storage.dart (#8)
* Update real_storage.dart * Update real_storage.dart * dart format
1 parent b90f40f commit 66c0219

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/src/impl/real_storage.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,13 @@ class RealRxStorage<Key extends Object, Options,
398398
Future<void> dispose() {
399399
assert(_debugAssertNotDisposed());
400400

401-
final doDisposing = () =>
401+
final dispose = () =>
402402
Future.wait(_writeQueueResources.values.map((q) => q.dispose()))
403-
.then((value) => _writeQueueResources.clear())
404-
.then((value) => _bag.dispose());
405-
406-
return _disposeMemo.runOnce(doDisposing).then((_) => _onDispose?.call());
403+
.then((_) => _writeQueueResources.clear())
404+
.then((_) => _bag.dispose());
405+
final future = _disposeMemo.runOnce(dispose);
406+
return _onDispose?.let((onDispose) => future.then((_) => onDispose())) ??
407+
future;
407408
}
408409
}
409410

0 commit comments

Comments
 (0)