Skip to content

Commit

Permalink
Regression: Workaround to handle auto stopped computations 😞 (#26745)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Aug 30, 2022
1 parent e13d7d2 commit 473455a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/meteor/client/hooks/useReactiveValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export const useReactiveValue = <T>(computeCurrentValue: () => T): T => {
});
});

const { stop } = computation;

computation.stop = (): void => undefined;

return [
(callback: () => void): (() => void) => {
callbacks.add(callback);
Expand All @@ -23,6 +27,7 @@ export const useReactiveValue = <T>(computeCurrentValue: () => T): T => {
callbacks.delete(callback);

if (callbacks.size === 0) {
computation.stop = stop;
computation.stop();
}
};
Expand Down

0 comments on commit 473455a

Please sign in to comment.