API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceAssetFactory
Builds one kind of runtime resource from normalized source data. A factory owns construction and teardown, and nothing else: it does not fetch, does not decide what a stored representation looks like, and never sees a cache. Acquisition is the loader's, representation is the AssetSourceCodec's, and caching is a policy neither of them knows about. One instance exists per Loader, created by AssetType.createFactory, so loader-local state - a worker, a compiled module, a parsed lookup shared by every resource of this type - belongs on the instance and is torn down with the loader that owns it.
import { AssetFactory } from '@codexo/exojs'Builds one kind of runtime resource from normalized source data.
A factory owns construction and teardown, and nothing else: it does not fetch, does not decide what a stored representation looks like, and never sees a cache. Acquisition is the loader's, representation is the AssetSourceCodec's, and caching is a policy neither of them knows about.
One instance exists per Loader, created by AssetType.createFactory, so loader-local state - a worker, a compiled module, a parsed lookup shared by every resource of this type - belongs on the instance and is torn down with the loader that owns it.
create(source: Source, context: AssetFactoryContextWhat a factory is told about the one resource it is building. There is deliberately no network, cache store or cache policy here. A factory receives source dat…<Options>): Promise<Resource>destroy?(): voiddispose?(resource: Resource): void