Skip to content

Commit

Permalink
Explicitly annotate the this value of set function (#3698)
Browse files Browse the repository at this point in the history
This is needed for some internal tooling.
  • Loading branch information
rictic committed Feb 27, 2023
1 parent b0c3f82 commit b9c27c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sweet-mice-love.md
@@ -0,0 +1,5 @@
---
'@lit-labs/context': patch
---

Explicitly annotate the this value of a set function. This makes some tooling happier.
2 changes: 1 addition & 1 deletion packages/labs/context/src/lib/decorators/provide.ts
Expand Up @@ -65,7 +65,7 @@ export function provide<ValueType>({
const oldSetter = descriptor?.set;
const newDescriptor = {
...descriptor,
set: function (value: ValueType) {
set: function (this: ReactiveElement, value: ValueType) {
controllerMap.get(this)?.setValue(value);
if (oldSetter) {
oldSetter.call(this, value);
Expand Down

0 comments on commit b9c27c5

Please sign in to comment.