throway232lasdf
throway232lasdf on Hacker News
Re:The type system is a programmer's best friend
on Saturday November 05, 2022 @11:05AM (#33482153)
> Why is it better to have two email types, VerifiedEmail and UnverifiedEmail vs. one Email type with an "isVerified" field?
You obviously have no idea what a type is.
type VerifiedEmail = { email: string; is_verified: true; };
type UnverifiedEmail = { email: string; is_verified: false; };
Re:The type system is a programmer's best friend
on Saturday November 05, 2022 @10:56AM (#33482062)
type VerifiedEmailOptedOutOfMarketing = { email: string; is_verified: true; is_opted_out: true; };