title: Redux : Reducer is not called
body: <p>I am making a mobile app by React Native and Redux.</p>
  
  <p>It seems that my actions, state are working properly because I did console.log them.</p>
  
  <p>The issue here is that my reducer is not called.</p>
  
  <p>I did log it on the console but there is no result.</p>
  
  <p>I don't know what is causing this.</p>
  
  <p>I try to fetch API data in Market.js</p>
  
  <p>I'd really appreciated if anyone helps me.</p>
  
  <p>my github repo : <a href="https://github.com/sj602/invescoin" rel="nofollow noreferrer">https://github.com/sj602/invescoin</a></p>
  
  <p>code as following:</p>
  
  <p>App.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import { Provider } from 'react-redux';
  import { Stacks } from './utils/Navigation';
  import {
    StyleSheet, Text, View,
  } from 'react-native';
  import { store } from './store';
  
  export default class App extends Component {
    render() {
      return (
        &lt;Provider store={store}&gt;
          &lt;Stacks /&gt;
        &lt;/Provider&gt;
      );
    }
  }
  
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
    },
  });
  </code></pre>
  
  <p>store.js</p>
  
  <pre><code>import {
    createStore,
    applyMiddleware,
    compose
  } from 'redux';
  import promise from 'redux-promise';
  import thunk from 'redux-thunk';
  import logger from 'redux-logger';
  import reducer from '../reducers';
  
  // const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
  
  export const store = createStore(
    reducer,
    // composeEnhancers(
      applyMiddleware(thunk)
    // )
  );
  </code></pre>
  
  <p>reducer.js</p>
  
  <pre><code>import { combineReducers } from 'redux';
  import {
    GET_MARKET_CAP,
    GET_MARKET_CAP_SUCCESS,
    GET_MARKET_CAP_FAIL,
    GET_GLOBAL_INFO,
  } from '../actions';
  
  
  const initialState = {
    isFetching: null,
    data: '',
    hasError: false,
    errorMessage: null,
  }
  
  export default function reducer(state = initialState, action) {
    switch (action.type) {
      case GET_MARKET_CAP:
        console.log(2)
        return ;
      case GET_MARKET_CAP_SUCCESS:
        console.log('success')
      case GET_MARKET_CAP_FAIL:
        return {
          ...state,
          marketCap: action.err
        }
      case GET_GLOBAL_INFO:
        console.log('action')
        return {
          ...state,
          bitcoinPercentage: action.bitcoinPercentage
        }
      default:
        return state;
    }
  }
  </code></pre>
  
  <p>actions.js</p>
  
  <pre><code> import {
    GET_MARKET_CAP,
    GET_MARKET_CAP_SUCCESS,
    GET_MARKET_CAP_FAIL,
    GET_GLOBAL_INFO
  } from './types.js';
  import * as api from '../utils/api';
  
  export const getMarketCap = (coin, currency) =&gt; dispatch =&gt; {
      return api.getMarketCap(coin, currency)
          .then(data =&gt; {
            dispatch({type: GET_MARKET_CAP_SUCCESS, data})
          })
          .catch(err =&gt; {
            dispatch({type: GET_MARKET_CAP_FAIL, err})
          })
  }
  
  export function getGlobalInfo() {
      return dispatch =&gt; {
        return api.getGlobalInfo().then(data =&gt; {
            dispatch({type: GET_GLOBAL_INFO, data})
          })
    }
  }
  </code></pre>
  
  <p>types.js</p>
  
  <pre><code>export const GET_MARKET_CAP = 'GET_MARKET_CAP';
  export const GET_MARKET_CAP_SUCCESS = 'GET_MARKET_CAP_SUCCESS';
  export const GET_MARKET_CAP_FAIL = 'GET_MARKET_CAP_FAIL';
  export const GET_GLOBAL_INFO = 'GET_GLOBAL_INFO';
  export const GET_COIN_PRICE = 'GET_COIN_PRICE';
  </code></pre>
  
  <p>Market.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import {
    View, Text, TouchableOpacity,
    ScrollView, TextInput
  } from 'react-native';
  import { connect } from 'react-redux';
  import {
    getMarketCap,
    getGlobalInfo,
  } from '../actions/index';
  import * as api from '../utils/api';
  import { cryptoList } from '../utils/cryptoList';
  
  class Market extends Component {
    componentDidMount() {
      this.props.getMarketCap('bitcoin', 'KRW').then(data =&gt; data[0]['market_cap_krw'])
  ;
      this.props.getGlobalInfo();
    }
  
    render() {
      return (
        &lt;View&gt;
          &lt;Text&gt;
            {this.props.market}
          &lt;/Text&gt;
          &lt;Text&gt;
            {this.props.bitcoinPercentage}
          &lt;/Text&gt;
        &lt;/View&gt;
      )
    }
  }
  
  const mapStateToProps = (state) =&gt; {
    return {
      market: state.market,
      bitcoinPercentage: state.bitcoinPercentage
    }
  }
  
  export default connect(mapStateToProps, {
    getMarketCap,
    getGlobalInfo
  })(Market)
  </code></pre>
  
  <p>api.js</p>
  
  <pre><code>const Coinmarketcap_URL = `https://api.coinmarketcap.com/v1/`;
  
  const headers = {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Authentication': 'c23R30cm2jOOExyAsG6pf5Xxy4QwpndxaIMRs6aOZxIQoUlMVOv1tCQZL3jZz'
  };
  
  export const getMarketCap = (coin, currency) =&gt; {
    return fetch(
      `${Coinmarketcap_URL}ticker/${coin}/?convert=${currency}`,
      {
        method: 'GET',
        headers,
      }
    )
    .then(res =&gt; res.json())
    .catch(e =&gt; console.log('Error occurred : ', e))
  }
  
  export const getGlobalInfo = () =&gt; {
    return fetch(
      `${Coinmarketcap_URL}global/`,
      {
        method: 'GET',
        headers,
      }
    )
    .then(res =&gt; res.json())
    .catch(e =&gt; console.log('Error occurred : ', e))
  }
  </code></pre>