Using guard case let syntax
In using guard case let, we assign the variable after the = sign
guard case var .content(shopState) = state.loadingState else {
return .none
}
// we can access `shopState` here
Linked Notes:
Pattern matching in Enum
While working using [[The Composable Architecture]] I often need to match a specific enum action or dealing with extracting associated value in enum. There’s a few different way to pattern matching an enum and extract its associated value: