Skip to content

Commit

Permalink
refactor: 💡 fix typo in embeddable (#69417) (#70053)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
streamich and elasticmachine authored Jun 26, 2020
1 parent 57d64fb commit 6106389
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/plugins/embeddable/public/lib/embeddables/embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export abstract class Embeddable<
// to update input when the parent changes.
private parentSubscription?: Rx.Subscription;

// TODO: Rename to destroyed.
private destoyed: boolean = false;
private destroyed: boolean = false;

constructor(input: TEmbeddableInput, output: TEmbeddableOutput, parent?: IContainer) {
this.id = input.id;
Expand Down Expand Up @@ -123,7 +122,7 @@ export abstract class Embeddable<
}

public updateInput(changes: Partial<TEmbeddableInput>): void {
if (this.destoyed) {
if (this.destroyed) {
throw new Error('Embeddable has been destroyed');
}
if (this.parent) {
Expand All @@ -135,7 +134,7 @@ export abstract class Embeddable<
}

public render(domNode: HTMLElement | Element): void {
if (this.destoyed) {
if (this.destroyed) {
throw new Error('Embeddable has been destroyed');
}
return;
Expand All @@ -155,7 +154,7 @@ export abstract class Embeddable<
* implementors to add any additional clean up tasks, like unmounting and unsubscribing.
*/
public destroy(): void {
this.destoyed = true;
this.destroyed = true;

this.input$.complete();
this.output$.complete();
Expand Down

0 comments on commit 6106389

Please sign in to comment.