MCPcopy Create free account
hub / github.com/msgbyte/tailchat / promiseLoading

Function promiseLoading

client/web/src/components/Loadable.tsx:25–38  ·  view source on GitHub ↗
(p: Promise<T>)

Source from the content-addressed store, hash-verified

23}
24
25function promiseLoading<T>(p: Promise<T>): Promise<T> {
26 const key = _uniqueId('Loadable');
27 message.loading({
28 content: t('加载中...'),
29 key,
30 duration: 0,
31 });
32
33 return p.then((r) => {
34 message.destroy(key);
35
36 return r;
37 });
38}
39
40interface LoadableOptions<P> extends OptionsWithoutResolver<P> {
41 /**

Callers 1

LoadableFunction · 0.85

Calls 2

tFunction · 0.50
destroyMethod · 0.45

Tested by

no test coverage detected