title: Get the state variable after dispatch is finished in react redux and saga?
body: <p>Hello I am fairly new to React, Redux and Saga. So I have a scenario where I have a .jsx file which is the view file then an action file used for dispatch and I am also using saga which updates the data in the reducers. Following are the file structurs:</p>
  <ol>
  <li>Action file:</li>
  </ol>
  <pre><code>export const getAction = (requestor) =&gt; ({
    type: GET_ACTION,
    data: {
      requestor,
    },
  });
  </code></pre>
  <ol start="2">
  <li>Reducer file</li>
  </ol>
  <pre><code>export const Reducer = (currentState = {}, action) =&gt; {
    const newState = { ...currentState };
  
    switch (action.type) {
      case GET_ACTION:
        newState.data = action.data;
        return newState;
    }  
  };
  </code></pre>
  <ol start="3">
  <li>Saga file</li>
  </ol>
  <pre><code>function* getData(action) {
    const { requestor } = action.data;
    try {
      const data = yield call(callService);
      if(success) {
        yield put( {type: GET_ACTION, data} );
      }
    } catch (e)
    {
    }
  }
  
  function* getDataSaga() {
    yield takeLatest(GET_ACTION, getData);
  }
  
  export {
    getData,
  };
  
  export default [
    getDataSaga,
  ];
  </code></pre>
  <ol start="4">
  <li>jsx file</li>
  </ol>
  <pre><code>const [dummy, setDummy] = useState([]);
  const data = useSelector(state =&gt; state.data, shallowEqual) || {};
  
  There is a function in which dispatch function is called.
  
  dispatch(getAction(requestor));
  </code></pre>
  <p>Now I need to access the updated state of data after dispatch has finished updating the data because after the data is updated I have to setDummy to set the dummy variable mentioned. Any way which I can be approaching to achieve that. I have tried to use dispatch.then but on UI it is saying .then is not a function for dispatch.</p>