Skip to content

Commit

Permalink
fix: πŸ› correctly await for .deleteEvents()
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 13, 2020
1 parent 5074725 commit 3951cdb
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class DynamicActionManager {

private stopped: boolean = false;

/**
* UI State of the dynamic action manager.
*/
protected readonly ui = createStateContainer(defaultState, transitions, selectors);

constructor(protected readonly params: DynamicActionManagerParams) {}
Expand All @@ -51,6 +54,10 @@ export class DynamicActionManager {
return oldEvent;
}

/**
* We prefix action IDs with a unique `.idPrefix`, so we can render the
* same dashboard twice on the screen.
*/
protected generateActionId(eventId: string): string {
return this.idPrefix + eventId;
}
Expand Down Expand Up @@ -214,7 +221,7 @@ export class DynamicActionManager {
* @param eventIds List of event IDs.
*/
public async deleteEvents(eventIds: string[]) {
await eventIds.map(this.deleteEvent.bind(this));
await Promise.all(eventIds.map(this.deleteEvent.bind(this)));
}

/**
Expand Down

0 comments on commit 3951cdb

Please sign in to comment.