Class: RiveCache
Defined in: asset-loading/asset-caches/rive-cache.ts:7
Class to manage the caching and loading of rive files.
Implements
AssetCache
<RiveFile
>
Constructors
Constructor
new RiveCache():
RiveCache
Returns
RiveCache
Properties
assets
assets:
Map
<string
,RiveFile
>
Defined in: asset-loading/asset-caches/rive-cache.ts:8
A map of asset paths to their corresponding assets.
Implementation of
Methods
get()
get(
path
):RiveFile
Defined in: asset-loading/asset-caches/rive-cache.ts:16
Retrieves an asset from the cache.
Parameters
path
string
The path of the rive file to retrieve.
Returns
RiveFile
The cached rive file.
Throws
Will throw an error if the rive file is not found in the cache.
Implementation of
getOrLoad()
getOrLoad(
path
,assetLoader?
):Promise
<RiveFile
>
Defined in: asset-loading/asset-caches/rive-cache.ts:57
Retrieves an asset from the cache if it exists, otherwise loads and caches it.
Parameters
path
string
The path of the rive file to retrieve or load.
assetLoader?
AssetLoadCallback
Returns
Promise
<RiveFile
>
A promise that resolves to the rive file.
Implementation of
load()
load(
path
,assetLoader?
):Promise
<void
>
Defined in: asset-loading/asset-caches/rive-cache.ts:32
Loads an asset from the specified path and caches it.
Parameters
path
string
The path of the rive file to load.
assetLoader?
AssetLoadCallback
Returns
Promise
<void
>
A promise that resolves when the rive file is loaded and cached.
Throws
Will throw an error if the rive file fails to load.