Skip to content

Commit

Permalink
Add error
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Oct 13, 2023
1 parent 2d2d32d commit 8960bdb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example/src/signals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ export class Effect<T> extends Signal<T> {
"Reading effect signals during the computation phase (from within computed signals) is not permitted."
);
}
if (this.status === DESTROYED) {
throw new Error(
"Cannot call get() on effect signals that have already been disposed."
);
}
if (isSignalDirty(this)) {
this.status = CLEAN;
updateEffectSignal(this);
Expand Down

0 comments on commit 8960bdb

Please sign in to comment.