MCPcopy Create free account
hub / github.com/SvelteStack/svelte-query / onSubscribe

Method onSubscribe

src/queryCore/core/queryObserver.ts:107–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105 }
106
107 protected onSubscribe(): void {
108 if (this.listeners.length === 1) {
109 this.currentQuery.addObserver(this)
110
111 if (shouldFetchOnMount(this.currentQuery, this.options)) {
112 this.executeFetch()
113 }
114
115 this.updateTimers()
116 }
117 }
118
119 protected onUnsubscribe(): void {
120 if (!this.listeners.length) {

Callers

nothing calls this directly

Calls 4

executeFetchMethod · 0.95
updateTimersMethod · 0.95
shouldFetchOnMountFunction · 0.85
addObserverMethod · 0.45

Tested by

no test coverage detected