1×
Become a member
to unlock all features
Autoplay

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

    reduxRedux
    typescriptTypeScript
    ^3.0.0

    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.