Suggest an editImprove this articleRefine the answer for “What does Selector do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Selector** in NgRx is a function that reads the data a component needs from the store without changing the state, and caches the result through `createSelector`. **Key point:** a Selector is like a filter: the store is large, but the component sees only the piece of state it needs.Shown above the full answer for quick recall.Answer (EN)Image`Selector` in NgRx is a **function for reading the data a component needs from the store**. It does not change the state, it just extracts what the component needs from it. ### Example Say the store holds: ```ts { user: { id: 1, name: 'Maria' }, cart: { items: [ ... ] } } ``` To get just the user's name, you write: ```ts const selectUserName = createSelector( state => state.user, user => user.name ); ``` And then in the component: ```ts this.store.select(selectUserName).subscribe(name => { console.log(name); }); ``` ### Why selectors are needed 1. **Convenient.** No need to manually dig deep into the store every time. 2. **Reusable.** One selector across different components. 3. **Performant.** `createSelector` caches the result and does not notify subscribers if the data hasn't changed. ### Conclusion `Selector` is like a filter: it shows the component only the piece of state it needs. The store is large, but you see only what matters.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.