Skip to content

Commit 4823f83

Browse files
Merge pull request #137 from jviide/fix-type
2 parents 627d837 + 4385ea8 commit 4823f83

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/quick-ladybugs-cry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@preact/signals-core": patch
3+
---
4+
5+
Fix `.subscribe`'s TypeScript type

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class Signal<T = any> {
123123
};
124124
}
125125

126-
subscribe(fn: (value: T) => () => void) {
126+
subscribe(fn: (value: T) => void): () => void {
127127
return effect(() => fn(this.value));
128128
}
129129

0 commit comments

Comments
 (0)