3

I am learning Redux (a JavaScript state container tool). I am finding numerous references to something called a "selector" (e.g. here, here, here, and here). However, I don't seem to be finding a simple definition of what a selector is (as opposed to, say, examples of selectors or details about some aspect of selector function which, while helpful, don't answer my main question). Stack Exchange and general Google searches don't seem to help (contaminated with lots of hits for CSS selectors which clearly are fundamentally different). So, in the context of Redux, what exactly is a selector? And is it a concept that is specific to Redux or is it a more general term? A link to official or unofficial documentation somewhere would also be helpful.

  • 3
    stackoverflow.com/q/38674200/5934037 – Laiv Apr 1 '17 at 17:59
  • 1
    @Laiv, the question that you link to is exactly what I was looking for. Not sure why I couldn't find that question in Google or Stack Exchange searches (or why Stack Exchange didn't suggest it when I entered my question), but thanks very much for the link. – Andrew Willems Apr 1 '17 at 23:12
  • 4
    I guess this comes from Relational Database terminology, where such an operation is called a selection and the keyword for it is SELECT. – Jörg W Mittag Apr 2 '17 at 9:36
1

From Laiv's comment and What are selectors in redux? a Redux selector is

a function that knows how to extract a specific piece of data from the store.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.