Skip to content

Commit

Permalink
Reordering setter overloads (#2333)
Browse files Browse the repository at this point in the history
* continue

* add changeset

---------

Co-authored-by: Ryan Carniato <ryansolid@gmail.com>
  • Loading branch information
Huliiiiii and ryansolid authored Oct 8, 2024
1 parent 5c52b56 commit bb6ce8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/empty-cars-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": patch
---

Reordering setter overloads
2 changes: 1 addition & 1 deletion packages/solid/src/reactive/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ export function createRoot<T>(fn: RootFunction<T>, detachedOwner?: typeof Owner)
export type Accessor<T> = () => T;

export type Setter<in out T> = {
<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)): U;
<U extends T>(
...args: undefined extends T ? [] : [value: Exclude<U, Function> | ((prev: T) => U)]
): undefined extends T ? undefined : U;
<U extends T>(value: (prev: T) => U): U;
<U extends T>(value: Exclude<U, Function>): U;
<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)): U;
};

export type Signal<T> = [get: Accessor<T>, set: Setter<T>];
Expand Down

0 comments on commit bb6ce8b

Please sign in to comment.