18 lines
439 B
Swift
18 lines
439 B
Swift
import SwiftUI
|
|
|
|
extension ConversationState {
|
|
static func reducer(state: inout ConversationState, action: ConversationAction) {
|
|
switch action {
|
|
case .makeConversationActive(let chat, let roster):
|
|
state.currentChat = chat
|
|
state.currentRoster = roster
|
|
|
|
case .messagesUpdated(let messages):
|
|
state.currentMessages = messages
|
|
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
}
|