rodydavis / signals.dart

Reactive programming made simple for Dart and Flutter
http://dartsignals.dev
Apache License 2.0
378 stars 44 forks source link

Wrapped the update processing of AsyncSignal.value in a batch #219

Closed rizumita closed 3 months ago

rizumita commented 3 months ago

When AsyncSignal.value is updated, the value propagates to the monitoring side while the state of _completer is not synchronized, so it has been fixed to ensure that the state of _completer is synchronized. By synchronizing, when AsyncData flows to subscribe, isCompleted simultaneously becomes true.

rodydavis commented 3 months ago

That's a great use of the batch!

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 58.67%. Comparing base (dd1d3f4) to head (1bb7243).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/rodydavis/signals.dart/pull/219/graphs/tree.svg?width=650&height=150&src=pr&token=Q2VW2FCMI0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rody+Davis)](https://app.codecov.io/gh/rodydavis/signals.dart/pull/219?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rody+Davis) ```diff @@ Coverage Diff @@ ## main #219 +/- ## ========================================== + Coverage 58.56% 58.67% +0.11% ========================================== Files 33 33 Lines 1419 1423 +4 ========================================== + Hits 831 835 +4 Misses 588 588 ``` | [Files](https://app.codecov.io/gh/rodydavis/signals.dart/pull/219?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rody+Davis) | Coverage Δ | | |---|---|---| | [packages/signals\_core/lib/src/async/signal.dart](https://app.codecov.io/gh/rodydavis/signals.dart/pull/219?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Rody+Davis#diff-cGFja2FnZXMvc2lnbmFsc19jb3JlL2xpYi9zcmMvYXN5bmMvc2lnbmFsLmRhcnQ=) | `100.00% <100.00%> (ø)` | |