MCPcopy
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
uniqByFunction · 0.80
router.test.tsxFile · 0.80
addCrawlPageTaskFunction · 0.80
getCSSRecursivelyFunction · 0.80
processEntryFunction · 0.80
findModuleDepsFunction · 0.80
handleCreateServerFnFunction · 0.80
detectKindsInCodeFunction · 0.80
compiler.tsFile · 0.80
generateFunctionIdMethod · 0.80
resolveIdentifierKindMethod · 0.80

Calls 1

tickMethod · 0.95

Tested by

no test coverage detected