boubiyeah
Joined 13 years ago
Joined 13 years ago
First few exams and I had WAY better marks than all of them, lol.
You could have:
type Result = {type: 'ok', value: string} | {type: 'err', value: string}
It would be easy to just say "yes, I got a bit carried away with the naming and my big future plans, but the community reaction made me realise perhaps it was not a great idea"
Insead he's like: "what? it was the plan all along :)"
A better naming for 99% of cases is (like found in Elm)
type Result error value = Ok value | Err error
As the maintainer, you don't want to cave in and add every possible configuration option people ask for so you have to decide what's a good, thin API for your component and it will never be enough for some usages. Styles are that much more subjective and even vary with design trends over the years!
It might be possible for very, very simple components like text inputs but then again, those are also the simplest to code directly in your framework, so you could wonder, why bother with an inferior programming paradigm in the first place?
The sweet spot for web components really seems tiny.
You could use the allowJs typescript flag and mostly use JS files at first; perhaps only typing a few models.