Example of Selectors
Explore how to implement Selectors in NgRx to retrieve slices of state data efficiently within Angular applications. This lesson helps you understand the use of createSelector and createFeatureSelector methods for accessing feature state and improving performance by avoiding redundant state retrieval calls. You'll also learn how to subscribe to selector results in components, enhancing your skills in reactive state management using NgRx.
What is the Selector?
The Selector allows us to get information for the State store without having to return the entire store.
Selectors are pure functions in NgRx, similar to Reducers.
NgRx helper functions
NgRx provides two helper functions: createSelector() and createFeatureSelector()
createFeatureSelector() method
The createFeatureSelector() method gets the feature state (the state of a feature module),
createSelector() method
The createSelector() method returns a selection of ...