-
Notifications
You must be signed in to change notification settings - Fork 326
Description
Previous discussion: gcanti/tcomb-form#377 (comment)
what's your motivation for moving from flow to ts?
There's plenty of reasons (I should write down a list..), maturity over all.
Do you consider it the spiritual successor to tcomb?
Yes and no, io-ts has a narrowed scope and wants to align with the TypeScript type system at the cost of possibly sacrifice some feature
I'm only sad that I can't use typescript class or interface syntax with it
Not sure I'm following
What's the point of runtime type checking inside a 100% typescript project
Mainly for IO validation but there are 4 use cases I'm interesting in
- IO validation
- runtime type introspection (which makes possible something like tcomb-form)
- "static types extraction"
- refinements
An example (POC) https://github.com/gcanti/prop-types-ts. There you get static AND runtime safety (so you please both TypeScript and non TypeScript users) with a single schema definition