title: Reselect - how to pass a result of one selector to another as an argument before combiner function?
body: <p>I have a selector that looks like this:</p>
  <pre><code>export const shipmentsRejectedSelector: (
    state: AppStateType,
    departmentIds: List&lt;number&gt;,
    currentDate: DateTime,
    toDate: DateTime
  ) =&gt; List&lt;Shipment&gt; = createImmutableEqualSelector(
    shipmentsByDepartmentIdsAndDate,
    packageEvents,
    (shipments, events) =&gt;
      shipments
        .valueSeq()
        .filter(s =&gt; s.get('state') == EventType.REJECTED))
        ?.toList() || List()
  )
  </code></pre>
  <p>Since <code>packageEvents</code> returns all <code>events</code> no matter what shipments it is part of, I would like to return only events that are part of the shipments returned by the <code>shipmentsByDepartmentIdsAndDate</code> selector. How can I pass <code>shipmentIds</code> to a new selector that would fetch only events that have the <code>shipmentIds</code> that I am passing?
  Something like this for example:</p>
  <pre><code>export const shipmentsRejectedSelector: (
        state: AppStateType,
        departmentIds: List&lt;number&gt;,
        currentDate: DateTime,
        toDate: DateTime
      ) =&gt; List&lt;Shipment&gt; = createImmutableEqualSelector(
        shipmentsByDepartmentIdsAndDate,
        shipments =&gt; packageEvents(shipments),
        (shipments, events) =&gt;
          shipments
            .valueSeq()
            .filter(s =&gt; s.get('state') == EventType.REJECTED))
            ?.toList() || List()
      )
  </code></pre>