Slide 14
Slide 14 text
“Make Illegal States Unrepresentable”
Good software artifacts
struct RequestData {
is_loading: bool,
is_loaded: bool,
is_error: bool,
value: Option,
error: Option,
}
let data = RequestData {
is_loading: true,
is_loaded: false,
is_error: true,
value: Some("oh no"),
error: None,
};