MCPcopy Create free account
hub / github.com/TanStack/query / subscribe

Method subscribe

packages/lit-query/src/useIsMutating.ts:89–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87 }
88
89 private subscribe(): void {
90 if (!this.queryClient) {
91 return
92 }
93
94 if (this.unsubscribe) {
95 return
96 }
97
98 this.unsubscribe = this.queryClient.getMutationCache().subscribe(() => {
99 this.setResult(this.computeValue())
100 })
101 }
102
103 private computeValue(): number {
104 if (!this.queryClient) {

Callers 2

onConnectedMethod · 0.95
onQueryClientChangedMethod · 0.95

Calls 2

computeValueMethod · 0.95
getMutationCacheMethod · 0.80

Tested by

no test coverage detected