MCPcopy Create free account
hub / github.com/DTStack/dt-react-component / loadImage

Function loadImage

src/image/index.tsx:17–24  ·  view source on GitHub ↗
(src: string)

Source from the content-addressed store, hash-verified

15}
16
17function loadImage(src: string) {
18 return new Promise((resolve, reject) => {
19 const i = new Image();
20 i.onload = () => resolve(true);
21 i.onerror = reject;
22 i.src = src;
23 });
24}
25
26export function useImage({ src }: { src: string }): {
27 src: string | undefined;

Callers 1

useImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected