Skip to content

Commit

Permalink
feat: add Computed.dispose #859
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Sep 4, 2022
1 parent 396cd93 commit 20fe5d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mobx/lib/src/core/computed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ class Computed<T> extends Atom implements Derivation, ObservableValue<T> {
return value;
}

void dispose() {
_suspend();
}

@override
void _suspend() {
_context._clearObservables(this);
Expand Down

0 comments on commit 20fe5d3

Please sign in to comment.