Skip to content

Commit

Permalink
Merge pull request #137 from jviide/fix-type
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister authored Sep 13, 2022
2 parents 627d837 + 4385ea8 commit 4823f83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quick-ladybugs-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@preact/signals-core": patch
---

Fix `.subscribe`'s TypeScript type
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Signal<T = any> {
};
}

subscribe(fn: (value: T) => () => void) {
subscribe(fn: (value: T) => void): () => void {
return effect(() => fn(this.value));
}

Expand Down

0 comments on commit 4823f83

Please sign in to comment.