I am expecting to be able to compose selectors form multiple data-access libs from two or more other data libs
I am currently getting an error in the createSelectors about No overload matches this call.
Please provide detailed steps for reproducing the issue.
online repo: Stackblitz
Please provide any relevant information about your setup:
It's pretty verbose, but would something like this work for now?
// Tell create selector to expect a partial state with both Airplane and Category features
export const getAllCategoriesWithAirplanes = createSelector<
CategoriesPartialState & AirplanesPartialState,
CategoriesEntity[],
AirplanesEntity[],
any[]
>(
getAllCategories,
getAllAirplanes,
(categories, airplanes) => {
return [];
}
);
The getCategoriesState
is restricted to the CategoriesPartialState
by default, so you can do what @mhamel06 mentioned above or:
export const getCategoriesState = createFeatureSelector<
CategoriesPartialState & AirplanesPartialState,
State
>(CATEGORIES_FEATURE_KEY);
Then your types will flow correctly.
Thank you works like a charm.
Most helpful comment
The
getCategoriesState
is restricted to theCategoriesPartialState
by default, so you can do what @mhamel06 mentioned above or:Then your types will flow correctly.