From bb6ce8b0f1f00b0895d2c26c65a3f2b7ee37deb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=90=E7=8B=B8?= <134658521+Huliiiiii@users.noreply.github.com> Date: Wed, 9 Oct 2024 03:37:20 +0800 Subject: [PATCH] Reordering setter overloads (#2333) * continue * add changeset --------- Co-authored-by: Ryan Carniato --- .changeset/empty-cars-jog.md | 5 +++++ packages/solid/src/reactive/signal.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/empty-cars-jog.md diff --git a/.changeset/empty-cars-jog.md b/.changeset/empty-cars-jog.md new file mode 100644 index 000000000..30753d6bb --- /dev/null +++ b/.changeset/empty-cars-jog.md @@ -0,0 +1,5 @@ +--- +"solid-js": patch +--- + +Reordering setter overloads diff --git a/packages/solid/src/reactive/signal.ts b/packages/solid/src/reactive/signal.ts index c119df121..ab86cf44b 100644 --- a/packages/solid/src/reactive/signal.ts +++ b/packages/solid/src/reactive/signal.ts @@ -179,12 +179,12 @@ export function createRoot(fn: RootFunction, detachedOwner?: typeof Owner) export type Accessor = () => T; export type Setter = { - (value: Exclude | ((prev: T) => U)): U; ( ...args: undefined extends T ? [] : [value: Exclude | ((prev: T) => U)] ): undefined extends T ? undefined : U; (value: (prev: T) => U): U; (value: Exclude): U; + (value: Exclude | ((prev: T) => U)): U; }; export type Signal = [get: Accessor, set: Setter];