Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 💡 fix typo in embeddable #69417

Merged
merged 2 commits into from
Jun 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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