In this case, Flow knows about Resource2 because of the way the
onItemClick prop is typed. It takes an argument typed as the union of
Resource2 . Hence when you pass a function that takes an object of type
Resource1 for the
onItemClick prop, it’s going to compare this type with this union type.
Redux is awesome for how it explicitly defines all possible state transformations (actions) and how those transformations mutate the store (reducers) — but it doesn’t prescribe a way for components to query the store.