Skip to content

Commit

Permalink
[lit-html] Make RefOrCallback generic (#3969)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfagnani committed Jun 22, 2023
1 parent 5bb4083 commit 7d8d4a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/smooth-swans-sin.md
@@ -0,0 +1,6 @@
---
'lit-html': patch
'lit': patch
---

Make RefOrCallback generic like Ref<T>
2 changes: 1 addition & 1 deletion packages/lit-html/src/directives/ref.ts
Expand Up @@ -38,7 +38,7 @@ const lastElementForContextAndCallback: WeakMap<
WeakMap<Function, Element | undefined>
> = new WeakMap();

export type RefOrCallback = Ref | ((el: Element | undefined) => void);
export type RefOrCallback<T = Element> = Ref<T> | ((el: T | undefined) => void);

class RefDirective extends AsyncDirective {
private _element?: Element;
Expand Down

0 comments on commit 7d8d4a1

Please sign in to comment.