Skip to content

Ability to cancel XKT model loading  #565

@xeolabs

Description

@xeolabs

When using XKTLoaderPlugin#load, make it possible to call PerformanceModel#destroy() on the model, while the model is still loading. This is effectively a "cancel loading" capability.

Previously, we needed to actually wait for a model to finish loading before we can call destroy() on it, as shown below. The problem here is that the whole model (and possibly metadata) needs to be loaded into the Viewer before we're allowed to destroy it, which is wasteful and might create a rough user experience.

const model = xktLoader.load(...);

model.on("loaded", ()=> {
    model.destroy();
});

Now we can just do this, if we need to:

const model = xktLoader.load(...);

model.destroy();

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions