Where I handle API calls in react-native and redux
<p>I'm building an Android app using <code>react-native</code> + <code>redux</code> + <code>immutable</code></p>

<p>I structured my app like this</p>

<pre><code>/src
 -/components
 -/actions (where I have action types and actions)
 -/reducers
 -/api (I'm not sure if I'm doing this right)
</code></pre>

<p>Ok, so I have a action where I need to make an API call with fetch like this:</p>

<pre><code>import * as types from './casesTypes'

export function getCases() {
    return {
      type: types.GET_CASES
    }
}
</code></pre>

<p>This is the cases reducer:</p>

<pre><code>const initialState = fromJS({
  isLoading: false,
  cases: null
})
export default function cases(state = initialState, action = {}) {

    switch(action.type) {

        case types.REQUEST_CASES:
          return state.set('isLoading', true)

        case types.RECIVE
          return state.set('cases', //set here the array that I recive from api call)

        default:
          return state
    }
}
</code></pre>

<p>So, the thing is that I dont really understand, where should I make the API call so that in the reducer I can merge my initial state with what I recive from the API call?</p>