Would be great if typescript allows pattern matching, then you’ll do
Err(e) => console.log(“error!”);
Ok(value) => console.log(value);
Maybe one day!
Actually you can do something similar:
It’s not as pretty as real pattern matching but it fits to this use car.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.