Nikky
12/15/2019, 9:17 AMwhen only works when the selaed class type is casted to outside
broken: https://i.imgur.com/tUusyIE.png▾
val reducer: Reducer<MultiplayerState> = { state, action ->
action as Actions
when(action) {
is Actions.AddObserver -> {
state.copy(observers = state.observers + action.observer)
}
is Actions.RemoveObserver -> {
state.copy(observers = state.observers - action.observer)
}
is Actions.SetConnectionState -> TODO()
}.exhaustive
}