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.

asked Apr 1, 2017 at 15:59
3
  • 3
    stackoverflow.com/q/38674200/5934037 Commented Apr 1, 2017 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. Commented Apr 1, 2017 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. Commented Apr 2, 2017 at 9:36

1 Answer 1

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

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.