This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers } from 'redux' | |
import navState from './navReducer' | |
const rootReducer = combineReducers({ | |
navState | |
}) | |
export default rootReducer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from 'redux' | |
import rootReducer from './rootReducer' | |
export default function configureStore () { | |
const store = createStore(rootReducer) | |
if (module.hot) { | |
module.hot.accept(() => { | |
const nextRootReducer = require('./rootReducer').default | |
store.replaceReducer(nextRootReducer) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { View, Text } from 'react-native' | |
import { connect } from 'react-redux' | |
import { push } from './navActions' | |
const styles = { | |
container: { | |
justifyContent: 'center', | |
alignItems: 'center', | |
flex: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { View, Text } from 'react-native' | |
import { connect } from 'react-redux' | |
import { pop } from './navActions' | |
const styles = { | |
container: { | |
justifyContent: 'center', | |
alignItems: 'center', | |
flex: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { | |
AppRegistry | |
} from 'react-native' | |
import { Provider } from 'react-redux' | |
import configureStore from './configureStore' | |
import App from './app' | |
const store = configureStore() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FETCHING_DATA, FETCHING_DATA_SUCCESS, FETCHING_DATA_FAILURE } from '../constants' | |
const initialState = { | |
data: [], | |
dataFetched: false, | |
isFetching: false, | |
error: false | |
} | |
export default function dataReducer (state = initialState, action) { | |
switch (action.type) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FETCHING_DATA, FETCHING_DATA_SUCCESS, FETCHING_DATA_FAILURE } from './constants' | |
export function getData() { | |
return { | |
type: FETCHING_DATA | |
} | |
} | |
export function getDataSuccess(data) { | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const FETCHING_DATA = 'FETCHING_DATA' | |
export const FETCHING_DATA_SUCCESS = 'FETCHING_DATA_SUCCESS' | |
export const FETCHING_DATA_FAILURE = 'FETCHING_DATA_FAILURE' |