title: Using component prop inside function body of reselect?
body: <p>Honestly, after hours of research, I totally don't understand reselect, so I just ask why I need it, and if it can help.</p>
  
  <blockquote>
    <p>Selectors are efficient. A selector is not recomputed unless one of its arguments changes.</p>
  </blockquote>
  
  <p>It's a bit unclear, what do we mean as <code>argument</code> here, but I assume that not the redux state, because otherwise there wouldn't be any point in reselect.</p>
  
  <p>My goal is to not calculate the whole list every time something happens, because it can contain thousands of elements.</p>
  
  <p>First question is that if for an example the value of <code>state["2"]</code> changes to 4 for an example, it will run through the whole list?</p>
  
  <pre><code>//for an example, in the next list, the key is the child,
  //and the value is it's parent
  const state = {
    1: 5,
    2: 5,
    3: 2,
    4: 1,
    5: 10,
    //...
    1000: 342
  };
  
  //and we have to find all children of a specific element,
  //what we get from the component's own props
  
  const getState = (
    state,
    props //okay, I can access it here
  ) =&gt; state;
  
  const getChildren = createSelector(
    [getState],
    state =&gt; Object.keys(state).filter(child =&gt; {
      const parent = state[child];
  
      return parent === props.id //but I need it here
    })
  );
  
  const mapStateToProps = (state, props) = ({ children: getChildren(state, props) });
  </code></pre>
  
  <p>And the main question: how can I access the props inside the function body?</p>