Skip to content

Commit

Permalink
Fix #300, add state intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Jan 14, 2021
1 parent 6b28920 commit 2fe6903
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/solid/src/reactive/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ type AddSymbolToStringTag<T> = T extends { [Symbol.toStringTag]: infer V }
type AddCallable<T> = T extends { (...x: any[]): infer V } ? { (...x: Parameters<T>): V } : {};

export type NotWrappable = string | number | boolean | Function | null;
// Intersection for missing fields https://github.com/microsoft/TypeScript/issues/13543
export type State<T> = {
[P in keyof T]: T[P] extends object ? State<T[P]> : T[P];
[P in keyof T]: T[P] extends object ? State<T[P]> & T[P] : T[P];
} & {
[$RAW]?: T;
} & AddSymbolToPrimitive<T> &
Expand Down

0 comments on commit 2fe6903

Please sign in to comment.