Loading
View sourceThe asset load is queued or still being processed.
Enum
Describes the numeric load lifecycle recorded in asset metadata by an
AssetServer.
AssetServer#load starts each new request in
LoadState.Loading. The server records LoadState.Loaded
when the asset is imported and stored successfully, or
LoadState.Failed when loading or importing fails.
import { AssetServer, Assets, LoadState } from '@wimaengine/asset'
class Texture {}
const server = new AssetServer()
server.registerAsset(new Assets(Texture))
const handle = server.load(Texture, '/textures/player.png')
const info = handle && server.getAssetInfo(handle)
const isPending = info?.loadstate === LoadState.LoadingThe asset load is queued or still being processed.
The asset could not be loaded or imported.
The asset was imported and stored successfully.