Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

deep partial typescript

//You can simply create a new type, say, DeepPartial, which basically references itself:
type DeepPartial<T> = {
    [P in keyof T]?: DeepPartial<T[P]>;
};

//Then, you can use it as such:
const foobar: DeepPartial<Foobar> = {
  foo: 1,
  bar: { baz: true }
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #deep #partial #typescript
ADD COMMENT
Topic
Name
1+7 =