ably-labs / ably-chat-swift

Ably Chat SDK for Swift to build chat experiences at scale
Apache License 2.0
0 stars 1 forks source link

Consider how to avoid the need for an unwrap of `error` properties #12

Open lawrence-forooghian opened 2 months ago

lawrence-forooghian commented 2 months ago

The RoomStatus and ConnectionStatus types introduced in #9 are currently just copied from the JS type. They have a current state property and an optional error property. I believe that error is guaranteed to be non-nil for certain values of current, so it should be possible for us to design an API that doesn't require an unwrap of error in those cases (i.e. make the error an associated value of the state enum). To do this, we first of all need to understand in which states the error is:

(Ditto for the corresponding *StateChange types.)

┆Issue is synchronized with this Jira Task by Unito