title: How can I get redux-saga to wait for two actions to happen at least once in any order?
body: <p>Redux saga noob here.</p>
  
  <p>I need to create a saga that loads the initial state for the redux store from my API server.</p>
  
  <p>This involves using two async sagas: <code>getCurrentUser</code> and <code>getGroups</code>.</p>
  
  <p>I need to issue these ajax requests in parallel and wait for the <code>GET_CURRENT_USER_SUCCESS</code> and <code>GET_GROUPS_SUCCESS</code> actions before issuing the <code>pageReady</code> action which tells the UI it's time to render the react components.</p>
  
  <p>I came up with a hacky solution:</p>
  
  <pre><code>function * loadInitialState () {
    yield fork(getCurrentUser)
    yield fork(getGroups)
  
    while (true) {
      yield take([
        actions.GET_GROUPS_SUCCESS,
        actions.GET_CURRENT_USER_SUCCESS
      ])
      yield take([
        actions.GET_GROUPS_SUCCESS,
        actions.GET_CURRENT_USER_SUCCESS
      ])
      yield put(actions.pageReady())
    }
  }
  </code></pre>
  
  <p>The problem with this code is that if for some reason <code>GET_GROUPS_SUCCESS</code> is issued twice, the <code>pageReady</code> action will be called to early.</p>
  
  <p>How can I get redux saga to wait for <code>GET_GROUPS_SUCCESS</code> and <code>GET_CURRENT_USER_SUCCESS</code> to happen <strong>at least once in any order</strong>?</p>