16 lines
448 B
Swift
16 lines
448 B
Swift
// TODO: implement complex merging list of messages
|
|
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
|
|
}
|
|
}
|
|
}
|