say in my store I have a feature with an array of data and an index
{
data: Data[],
activeIndex: -1
}
What I want to do is, every time activeIndex changes, I get notified and get data[activeIndex]
so I have a selector
const selectActiveIndex = creatSelector(
selectFeature,
(feature) => feature.activeIndex
)
But how do I get data[activeIndex] in my component?
Thanks
You can compose a selector based on other selectors, here you can combine the results into a single result. This combined selector can then be used in the component.
component: