Closed arman-hk closed 1 year ago
@arman-hk this uses the if let
shorthand introduced in Swift 5.7: https://github.com/apple/swift-evolution/blob/main/proposals/0345-if-let-shorthand.md — functionally it's equivalent to
guard let lastChatContext = lastChatContext else {
canClearContext = false
return
}
as we're using the bound non-optional value of lastChatContext
on line 77.
tbh this would be better written using Combine rather than in the didSet {}
, I've been tweaking some of these as I've been going back through the codebase as well.
@alexrozanski, Thank you for clarifying the use of the shortened syntax; I wasn't aware of this new feature. looking forward to seeing the codebase improvements!
Hey @alexrozanski, at line 73 of ChatModel.swift, you have this:
It seems like a condition is missing:
Shouldn't it look something like the above?