title: Best Way To Update Another Redux Store From Redux-Saga Function
body: <p>I have a React/Redux app and I chose to organize the Redux state into 2 main sections, ads and tasks and am using combineReducers.</p>
  
  <p>Ads are created first. A single ad or a collection of ads can be grouped and assigned to a new task.</p>
  
  <p>In my ads store I have reducers and saga functions that make the api calls related to ads and update the Redux state for ads.</p>
  
  <p>In my task store I have reducers and saga functions that make api calls related to tasks and update the Redux state for tasks.</p>
  
  <p>When a task is created from a collection of ads I need to update the Ads Redux state. Originally I was just dispatching my ads action creator that makes an api call and retrieves an updated list of all ads. Unfortunately that api call is a very complicated query and as a result fairly time consuming.</p>
  
  <p>When I make the api call to create the task I get some data back that I could use to update the ads Redux state with avoiding having to make that slow api call.</p>
  
  <p>Because multiple ads can go into creating a task my ad id's are stored in an array.</p>
  
  <p>I'm trying to figure out how I can loop through that array and dispatch a reducer in the ads Redux store to update state with this data.</p>
  
  <p>One issue I ran into is an error stating that yield can not be called from inside the forEach loop I was using to iterate over the array of ad id's.</p>
  
  <p>The other issue is just finding the best way to update state from one Redux store in another.</p>
  
  <p>I suppose I could just combine everything into a single Redux store but that file would be endlessly long.</p>
  
  <p>Not sure which direction to go here.</p>