MCPcopy Create free account
hub / github.com/TanStack/router / add

Method add

packages/start-plugin-core/src/queue.ts:68–87  ·  view source on GitHub ↗
(fn: () => Promise<T> | T, { priority }: { priority?: boolean } = {})

Source from the content-addressed store, hash-verified

66 }
67
68 add(fn: () => Promise<T> | T, { priority }: { priority?: boolean } = {}) {
69 return new Promise<any>((resolve, reject) => {
70 const task = () =>
71 Promise.resolve(fn())
72 .then((res) => {
73 resolve(res)
74 return res
75 })
76 .catch((err) => {
77 reject(err)
78 throw err
79 })
80 if (priority) {
81 this.pending.unshift(task)
82 } else {
83 this.pending.push(task)
84 }
85 this.tick()
86 })
87 }
88
89 throttle(n: number) {
90 this.currentConcurrency = n

Callers 15

RouterCoreClass · 0.80
appendUniqueUserTagsFunction · 0.80
stripSearchParamsFunction · 0.80
getScrollToTopElementsFunction · 0.80
setupScrollRestorationFunction · 0.80
walkIdentifierNodeFunction · 0.80
buildDependencyGraphFunction · 0.80

Calls 1

tickMethod · 0.95

Tested by 1

trackFunction · 0.64