Can't extend from generics

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • Unfortunately, if you have methods that do take their own type parameters, you can't really manipulate those function types without losing the generic aspect. See, for example: https://github.com/microsoft/TypeScript/issues/39594

  • deepmerge-ts

    Deeply merge 2 or more objects respecting type information.

  • Luckily however, there is a work around you can use to get HKTs. fp-ts is a library that has helper types for doing so. I also use these HKTs in my own library and have documentation on how they work. The docs should hopefully help explain how they work and how you can use them in your own code.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • fp-ts

    Functional programming in TypeScript

  • Luckily however, there is a work around you can use to get HKTs. fp-ts is a library that has helper types for doing so. I also use these HKTs in my own library and have documentation on how they work. The docs should hopefully help explain how they work and how you can use them in your own code.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts