I follow the example of ngrx store as follows
There is a code in example.reducer.ts
export const { selectAll: selectAllCars } = adapterCar.getSelectors();
And the outside calls
export const selectAllCars = createSelector(selectCarState, fromExample.selectAllCars);
Not call selectAll
Sorry to ask but I have no idea how to search it. Could you please explain how it works?
It's a destructuring assignment. It's supposed to improve code readibility, but I wonder if it isn't misused here.
export const { selectAll: selectAllCars } = adapterCar.getSelectors();
means the same as
const carSelectors = adapterCar.getSelectors();
const selectAllCars = carSelectors.selectAll;
export { selectAllCars };