musicians: Musician[]; isLoading: boolean; query: string; } const initialState = { musicians: [], isLoading: false, query: '' }; const reducer = createReducer(initialState, ** **. */); export const musiciansFeature = createFeature({ name: 'musicians', reducer, extraSelectors: ({ selectMusicians, selectQuery }) => ({ selectFilteredMusicians: createSelector( selectMusicians, selectQuery, (musicians, query) => musicians.filter(({ name }) => name.includes(query)) ), }), }); const { name, reducer, selectMusiciansState, */ feature selector */ selector for each feature state property selectMusicians, selectIsLoading, selectQuery, selectFilteredMusicians, */ extra selectors } = musiciansFeature; musicians.selectors.ts import { createFeatureSelector, createSelector, } from '@ngrx/store'; import * as fromMusicians from './musicians.reducer'; export const selectMusiciansState = createFeatureSelector<fromMusicians.State>('musicians'); export const selectMusicians = createSelector( selectMusiciansState, (state) => state.musicians ); export const selectIsLoading = createSelector( selectMusiciansState, (state) => state.isLoading ); export const selectQuery = createSelector( selectMusiciansState, (state) => state.query ); export const selectFilteredMusicians = createSelector( selectMusicians, selectQuery, (musicians, query) => musicians.filter(({ name }) => name.includes(query)) );