Types
import type { LoadableMixin } from "@arcgis/core/core/Loadable.js";
Subclasses
Basemap, Basemap, Ground, Ground, WebDocument2D, WebScene, SharedTemplate, Mesh, Layer, Layer, BuildingComponentSublayer, BuildingSummaryStatistics, MediaElementBase, MediaElementBase, KMLSublayer, KMLSublayer, LocalMediaElementSource, Sublayer, Sublayer, SubtypeSublayer, SubtypeSublayer, Network, Network, Portal, Portal, PortalItem, PortalItem, FeatureService, FeatureService, VersionManagementService, VersionManagementService, VersioningState, VersioningState, BasemapGalleryViewModel, BasemapGalleryViewModel, PortalBasemapsSource, PrintViewModel
Since
ArcGIS Maps SDK for JavaScript 4.0

Loadable is a mixin class that provides a standardized way to load resources asynchronously. Many classes in the API that load resources from a remote source extend this class.

Properties

PropertyTypeClass
readonly
readonly
"not-loaded" | "loading" | "failed" | "loaded"
readonly
any[]

loadError

readonly Property
Type
EsriError | null | undefined

The Error object returned if an error occurred while loading.

loadStatus

readonly Property
Type
"not-loaded" | "loading" | "failed" | "loaded"

Represents the status of a load() operation.

ValueDescription
not-loadedThe object's resources have not loaded.
loadingThe object's resources are currently loading.
loadedThe object's resources have loaded without errors.
failedThe object's resources failed to load. See loadError for more details.
Default value
"not-loaded"

loadWarnings

readonly Property
Type
any[]

A list of warnings which occurred while loading.

Methods

MethodSignatureClass
cancelLoad(): this
load(options?: AbortOptions | null | undefined): Promise<this>

cancelLoad

Method
Signature
cancelLoad (): this

Cancels a load() operation if it is already in progress.

Returns
this

load

Method
Signature
load (options?: AbortOptions | null | undefined): Promise<this>

Loads the resources referenced by this class. This method automatically executes for a View and all of the resources it references in Map if the view is constructed with a map instance.

This method must be called by the developer when accessing a resource that will not be loaded in a View.

The load() method only triggers the loading of the resource the first time it is called. The subsequent calls return the same promise.

It's possible to provide a signal to stop being interested into a Loadable instance load status. When the signal is aborted, the instance does not stop its loading process, only cancelLoad() can abort it.

Parameters

ParameterTypeDescriptionRequired
options

Additional options.

Returns
Promise<this>

Resolves when the resources have loaded.

Type definitions

Loadable

Type definition
Supertypes
EsriPromise ‚  LoadableMixin