Skip to content

Commit

Permalink
Pass reference
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 15, 2023
1 parent 7363e50 commit 8375959
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/projector/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ export class ProjectorHtml extends Projector {
/**
* Custom HTML to use instead of generated HTML.
*/
public html: string | (() => string) | (() => Promise<string>) | null =
null;
public html:
| string
| ((self: this) => string)
| ((self: this) => Promise<string>)
| null = null;

/**
* ProjectorHtml constructor.
Expand All @@ -191,7 +194,7 @@ export class ProjectorHtml extends Projector {
public async getHtml() {
const {html} = this;
if (html) {
return typeof html === 'function' ? html() : html;
return typeof html === 'function' ? html(this) : html;
}
return this.getHtmlDefault();
}
Expand Down

0 comments on commit 8375959

Please sign in to comment.