Deeply mark all the properties of a type as read-only in TypeScript

InstructorRares Matei

Share this video with your friends

Send Tweet

We will look at how we can use mapped types, conditional types, self-referencing types and the “infer” keyword to create a reusable generic type that traverses down the properties of an object and marks of all them as read-only. This is especially useful when used with Redux, to ensure our whole state tree is marked as read-only and immutable.