is there any way to achieve this behavior without ...
# announcements
c
is there any way to achieve this behavior without the compilation error?
d
No. Even if you make
A
of
Reducer
an
in A
your
TodoReducer
still says: "I want a
TodoListAction
. But
Reducer<TodosState, TodoAction>
says "I want a TodoAction". So if that assignment was allowed, your
TodoReducer
could receive something that is a
TodoAction
, but not a
TodoListAction
, and thus the assignment is not valid
c
I've made a "helper" function in order to allow an exhaustive when...