Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/algolia/autocomplete
/ defer
Function
defer
test/utils/defer.ts:1–5 ·
view source on GitHub ↗
(fn: () => TValue, timeout: number)
Source
from the content-addressed store, hash-verified
1
export
function
defer<TValue>(fn: () => TValue, timeout: number) {
2
return
new
Promise<TValue>((resolve) => {
3
setTimeout(() => resolve(fn()), timeout);
4
});
5
}
Callers
10
createAlgoliaInsightsPlugin.test.ts
File · 0.90
metadata.test.ts
File · 0.90
createConcurrentSafePromise.test.ts
File · 0.90
debouncing.test.ts
File · 0.90
getSources
Function · 0.90
stallThreshold.test.ts
File · 0.90
metadata.test.ts
File · 0.90
concurrency.test.ts
File · 0.90
delayedGetSources
Function · 0.90
getItems
Function · 0.90
Calls
1
resolve
Function · 0.85
Tested by
3
getSources
Function · 0.72
delayedGetSources
Function · 0.72
getItems
Function · 0.72