Skip to content

Commit

Permalink
feat: Allow passing a type to html function in browser build
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmilton committed Jul 13, 2024
1 parent 8ac8c76 commit ba91058
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/browser/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ export const h = <T extends Node & ChildNode = Element>(
return node;
};

export const html = (
export const html = <T extends Node & ChildNode = Element>(
template: TemplateStringsArray,
...substitutions: unknown[]
): View => h(String.raw(template, ...substitutions));
): View & T => h(String.raw(template, ...substitutions));

/**
* Collects node refs from a compiled template view.
Expand Down

0 comments on commit ba91058

Please sign in to comment.