Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 4x 4x 4x 5x 4x 4x 4x 4x 4x 4x 1x | import { createSelector } from '@ngrx/store';
import { getStoreLocatorState } from '../store-locator-store';
import { initialState, storesAdapter } from './stores.reducer';
const getStoresState = createSelector(getStoreLocatorState, state => state?.stores ?? initialState);
const { selectEntities, selectAll } = storesAdapter.getSelectors(getStoresState);
export const getStores = selectAll;
export const getLoading = createSelector(getStoresState, state => state.loading);
export const getError = createSelector(getStoresState, state => state.error);
const getHighlightedStoreId = createSelector(getStoresState, state => state.highlighted);
export const getHighlightedStore = createSelector(
selectEntities,
getHighlightedStoreId,
(entities, highlightedId) => entities[highlightedId]
);
|