(p: Promise<T>)
| 23 | } |
| 24 | |
| 25 | function 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 | |
| 40 | interface LoadableOptions<P> extends OptionsWithoutResolver<P> { |
| 41 | /** |