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

Method subscribe

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

Source from the content-addressed store, hash-verified

91 }
92
93 private subscribe(): void {
94 if (!this.queryClient) {
95 return
96 }
97
98 if (this.unsubscribe) {
99 return
100 }
101
102 this.unsubscribe = this.queryClient.getMutationCache().subscribe(() => {
103 this.setResult(this.computeValue())
104 })
105 }
106
107 private computeValue(): number {
108 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