Reputation: 55
I would like to make a selector function like so:
const selectSomethingById = (state, id) => return state.something[id];
I cannot make it to work. I would have some components calling it like so:
const something = useSelector(selectSomethingById(id));
Upvotes: 0
Views: 577
Reputation: 854
const something = useSelector(state => selectSomethingById(state, id))
Upvotes: 1