I don't really like using regexes here but it's the most intuitive API for defining a validation rule. Super trivial to implement in a type checker too (if it's written in JS, just delegate to the runtime engine). Could have some way to specify the actual message for errors too.
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I want a type error.
- 2 more replies
New conversation -
-
-
I'm continuously blown away by the momentum and innovation of the TypeScript team
https://twitter.com/drosenwasser/status/1062452381743439872 …Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This is what
@flowtype opaque types are for. Opaque types are super flexible as they can support arbitrary constraints on any value. Also see dependent type systems. -
Unclear how that would cover this use case? Imagine you had some CSS-in-JS API where you have your CSS properties typed. How would you define the `color` property without just using `string`?
- 3 more replies
New conversation -
-
- End of conversation
New conversation -
-
Check Facebook's internal Flow support group. I asked for that feature before, and remember that there was a good reply. That feature would be helpful in many cases.
-
Just checked and it was "that's a great idea, we don't have time, PRs accepted" which is about what I expected haha
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 