Skip to content

Commit 8dd9458

Browse files
committed
remove identity
1 parent 3a0735a commit 8dd9458

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/watch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { batch, batchFlush, batchStart, tasks } from "./batch";
22
import { type Disposer, type Get, type Readable } from "./typings";
3-
import { identity, isReadable, unsubscribe } from "./utils";
3+
import { isReadable, unsubscribe } from "./utils";
44

55
export interface WatchEffect {
66
(get: Get, dispose: Disposer): (() => void) | undefined | void;
@@ -37,7 +37,7 @@ export const watch = (effect: WatchEffect): Disposer => {
3737
const dispose = () => {
3838
disposed = true;
3939
tasks.delete(runner);
40-
effect = identity;
40+
effect = null as any; // enable gc
4141
unsubscribe(collectedDeps, subscription);
4242
collectedDeps = undefined;
4343
if (cleanupEffect) {

0 commit comments

Comments
 (0)