@fogrexon/glyph-arena-assets

URL asset loading with in-memory cache. See also package README.

Exports

Generated from the package's source when the docs are built — do not edit this table by hand.

NameKind
Assetstype
CreateAssetsOptionstype
LoadOptionstype
createAssetsfunction

createAssets(options?)

const assets = createAssets({
  fetch?,              // optional
  createImageBitmap?,  // optional
});

await assets.loadText(url, { signal? });
await assets.loadJson(url, { signal? });
await assets.loadBytes(url, { signal? });
await assets.loadImage(url, { signal? });

assets.evict(url);
assets.dispose();

Options

Methods

LoadOptions

FieldDescription
signal?optional AbortSignal passed to fetch

Caching

HTTP errors

Non-OK responses reject with Error("HTTP <status> for <url>").

loadImage requirements

Rejects with "createImageBitmap is not available" when no decoder is provided and globalThis.createImageBitmap is missing.

Evict during in-flight load

Does not abort the in-flight request. On success, the result is not re-cached; the next load fetches again.