Skip to content

Commit 587e702

Browse files
authored
Loosen up types for (un)watchedc (#688)
1 parent 62bed44 commit 587e702

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/breezy-cherries-type.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+
Loosen up types for `watched` and `unwatched`

packages/core/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ declare class Signal<T = any> {
273273
}
274274

275275
export interface SignalOptions<T = any> {
276-
watched: (this: Signal<T>) => void;
277-
unwatched: (this: Signal<T>) => void;
276+
watched?: (this: Signal<T>) => void;
277+
unwatched?: (this: Signal<T>) => void;
278278
}
279279

280280
/** @internal */

0 commit comments

Comments
 (0)