Skip to content

Commit f9fc4ba

Browse files
committed
refactor: move hasListeners
1 parent 6ed3421 commit f9fc4ba

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/core/mutationObserver.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ export class MutationObserver<
6565
}
6666
}
6767

68-
hasListeners(): boolean {
69-
return this.listeners.length > 0
70-
}
71-
7268
onMutationUpdate(): void {
7369
this.updateResult()
7470
this.notify()

src/core/queryObserver.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ export class QueryObserver<
9595
}
9696
}
9797

98-
hasListeners(): boolean {
99-
return this.listeners.length > 0
100-
}
101-
10298
willFetchOnMount(): boolean {
10399
return (
104100
this.options.enabled !== false &&

src/core/subscribable.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export class Subscribable<TListener = Listener> {
2020
}
2121
}
2222

23+
hasListeners(): boolean {
24+
return this.listeners.length > 0
25+
}
26+
2327
protected onSubscribe(): void {
2428
// Do nothing
2529
}

0 commit comments

Comments
 (0)