Create selector from existing selector

39 Views Asked by At

I'm updating my Angular 14 to 15. In my app we have a selector like

export const selectPlaces = createSelector(
  locations, //Feature selector
  (state) => state?.locations
);

Then I need to get another key value from locations say it as 'gardens'

export const selectGardens = createSelector(
  selectPlaces,
  (state) => state?.gardens
);

In Angular version 14 I can do this, but not in Angular 15. Error is

MemoizedSelector<object, IState | undefined, (s1: IState ) => IState | undefined>' is not assignable to parameter of type '[SelectorWithProps<unknown, unknown, IState >, SelectorWithProps<unknown, unknown, unknown>, SelectorWithProps<unknown, unknown, unknown>, ... 4 more ..., SelectorWithProps<...>]

I have selectors with multiple selectors as parameters. How can I solve this?

0

There are 0 best solutions below