Selector Composition
Get introduced to the concept of selector composition.
We'll cover the following...
Introduction
We have already learned about the createFeatureSelector()
function, which retrieves an entire slice from the store. We utilized this function to create the getProductSelector
and the getProductsSelector
in our application.
import { createFeatureSelector } from "@ngrx/store";import { ProductsState } from "./products.interfaces";export const getProductsSelector = createFeatureSelector<ProductsState>('products')
Defining the getProductsSelector function
We may not always need the entire slice value in our application. We may need a specific property of that slice. In other scenarios, we may need to combine multiple slices to get the desired value. The ...