Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { AppRegistry } from 'react-native';
- import {Provider} from 'react-redux';
- import {createStore, applyMiddleware } from 'redux';
- import promiseMiddleware from 'redux-promise';
- import reducers from './src/store/reducers';
- import App from './App';
- const createStoreWithMiddleware = applyMiddleware(promiseMiddleware)(createStore)
- const appRedux = () => (
- <Provider store={createStoreWithMiddleware()}>
- <App />
- </Provider>
- )
- AppRegistry.registerComponent('ProjectThree', () => appRedux);
- import {combineReducers} from 'redux';
- import article_reducer from './article_reducer';
- const rootReducer = combineReducers({
- article_reducer
- })
- export default rootReducer;
- export default function(state={}, action){
- switch(action.type){
- case 'GET_ARTICLES' :
- return {...state, articles : action.payload}
- default :
- return state;
- }
- }
Add Comment
Please, Sign In to add comment