I ended up changing fooSelector
to return a bogus value instead of throwing. Basically something like:
export const fooSelector = createSelector(
inputSelector1,
inputSelector2,
inputSelector3,
(
input1: Input1,
input2: Input2,
input3: Input3,
): Foo => {
if (!isValid(input1, input2, input3)) {
// not a valid Foo, so anything that tries to use this will throw
// an error
return {} as Foo;
}
// combine input1, input2, input3 like before
}
);