15 lines
323 B
Swift
15 lines
323 B
Swift
extension ChatsState {
|
|
static func reducer(state: inout ChatsState, action: ChatsAction) {
|
|
switch action {
|
|
case .chatsListUpdated(let chats):
|
|
state.chats = chats
|
|
|
|
case .chatStarted(let chat):
|
|
state.currentChat = chat
|
|
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
}
|