theia-ide / sprotty

A next-gen web-based graphics framework
Apache License 2.0
138 stars 23 forks source link

Enhanced LocalModelSource and ActionDispatcher API to return promises #214

Closed spoenemann closed 6 years ago

spoenemann commented 6 years ago

While working on https://github.com/TypeFox/npm-dependency-graph I realized that we need a better way to interact with a LocalModelSource. With this change I can write code like

this.loadIndicator(true);
// change the current model...
await this.updateModel();
this.loadIndicator(false);

In general, whenever an action is dispatched, I get a promise that is resolved when the effect is visible (i.e. the command has been executed and the viewer has updated the DOM).