Skip to content

Commit

Permalink
Fix type for safeCustomElement
Browse files Browse the repository at this point in the history
  • Loading branch information
laymonage committed Oct 28, 2023
1 parent aadb3ab commit 886c4b2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions web/src/giscus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import { createRef, ref, Ref } from 'lit/directives/ref.js';

function safeCustomElement(tagName: string): ReturnType<typeof customElement> {
// Prevents re-registering an element.
return customElements.get(tagName)
? (v: ReturnType<ReturnType<typeof customElement>>) =>
v as ReturnType<typeof customElement>
: customElement(tagName);
return customElements.get(tagName) ? (v) => v : customElement(tagName);
}

/**
Expand Down

1 comment on commit 886c4b2

@vercel
Copy link

@vercel vercel bot commented on 886c4b2 Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

giscus-component – ./

giscus-component-git-main-giscus.vercel.app
giscus-component.vercel.app
giscus-component-giscus.vercel.app

Please sign in to comment.