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

Method dispatch

src/queryCore/core/query.ts:515–525  ·  view source on GitHub ↗
(action: Action<TData, TError>)

Source from the content-addressed store, hash-verified

513 }
514
515 private dispatch(action: Action<TData, TError>): void {
516 this.state = this.reducer(this.state, action)
517
518 notifyManager.batch(() => {
519 this.observers.forEach(observer => {
520 observer.onQueryUpdate(action)
521 })
522
523 this.cache.notify({ query: this, type: 'queryUpdated', action })
524 })
525 }
526
527 protected getDefaultState(
528 options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>

Callers 4

setDataMethod · 0.95
setStateMethod · 0.95
invalidateMethod · 0.95
fetchMethod · 0.95

Calls 4

reducerMethod · 0.95
batchMethod · 0.80
onQueryUpdateMethod · 0.80
notifyMethod · 0.45

Tested by

no test coverage detected