15 lines
396 B
Swift
15 lines
396 B
Swift
extension ConversationState {
|
|
static func reducer(state: inout ConversationState, action: ConversationAction) {
|
|
switch action {
|
|
case .makeConversationActive(let chat):
|
|
state.currentChat = chat
|
|
|
|
case .messageForCurrentConversationReceived(let message):
|
|
state.currentMessages.append(message)
|
|
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
}
|