Skip to content

Commit

Permalink
fix: prevent updating holden when other calculate is running.
Browse files Browse the repository at this point in the history
  • Loading branch information
ali77gh committed Mar 31, 2023
1 parent 03f1683 commit 02a8676
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/telescope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class Telescope<T> {
isCalculating?.value = true;
int dh = getDependenciesHash();
cal().then((value) {
int cdh = getDependenciesHash();
if(dh!=cdh) return;
hashmap?[dh] = value;
holden = value;
isCalculating?.value = false;
Expand All @@ -87,6 +89,8 @@ class Telescope<T> {
isCalculating?.value = true;
int dh = getDependenciesHash();
cal().then((value) {
int cdh = getDependenciesHash();
if(dh!=cdh) return;
hashmap?[dh] = value;
holden = value;
isCalculating?.value = false;
Expand Down

0 comments on commit 02a8676

Please sign in to comment.