Skip to content

Commit 3994866

Browse files
authored
Merge pull request #25 from r0skar/master
[@types] Only wrap state props of type object
2 parents 50b01ad + d12632f commit 3994866

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Proxy<T> = {
1414
}
1515
type Partial<T> = { [P in keyof T]?: Partial<T[P]> }
1616
type Wrapped<T> = {
17-
[P in keyof T]: Proxy<T[P]>;
17+
[P in keyof T]: T[P] extends object ? Proxy<T[P]> : T[P];
1818
} & { _state: T }
1919
type StateAtom = string | number | boolean | symbol | null | undefined | any[]
2020
type StateSetter<T> = (

0 commit comments

Comments
 (0)