title: Redux-saga takeLatest conditionally
body: <p>I have a question related to redux-saga that is there any way to achieve takeLatest but with condition.</p>
  <p>For example, I have a dynamical list of song types (Rap, Pop, Hip_hop...), I want to fetch the songs by song type. I define an redux-action with type &quot;FETCH_SONGS_BY_TYPE&quot; then pass songType to it. The action will look like</p>
  <pre><code>// actions
  const fetchSongsByType = songType =&gt; ({
    type: FETCH_SONGS_BY_TYPE,
    songType
  });
  --------------------------------------------------
  //saga
  function* fetchSongsByTypeSaga(action) {
     // request songs list by action.songType
  }
  function* Saga() {
    yield takeLatest(FETCH_SONGS_BY_TYPE, fetchSongsByTypeSaga);
  }
  </code></pre>
  <p>So I want that the previous saga task is only canceled if the next saga run has the same songType.</p>
  <p>In above code, I got this:</p>
  <ol>
  <li>fetchSongs - songType: Hip_hop (canceled because of [2])</li>
  <li>fetchSongs - songType: Rap (canceled because of [3])</li>
  <li>fetchSongs - songType: Pop (canceled because of [4])</li>
  <li>fetchSongs - songType: Rap (canceled because of [5])</li>
  <li>fetchSongs - songType: Pop</li>
  </ol>
  <hr />
  <p>But I expected it will be like this:</p>
  <ol>
  <li>fetchSongs - songType: Hip_hop</li>
  <li>fetchSongs - songType: Rap (canceled because of [4])</li>
  <li>fetchSongs - songType: Pop (canceled because of [5])</li>
  <li>fetchSongs - songType: <strong>Rap</strong></li>
  <li>fetchSongs - songType: <strong>Pop</strong></li>
  </ol>
  <p>I appreciate any helps, thanks in advance.</p>