-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
29 lines (24 loc) · 840 Bytes
/
App.js
File metadata and controls
29 lines (24 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import { YellowBox, AppRegistry } from 'react-native';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { init as websocketInit, emit } from './actions/websockets';
import AppReducer from './reducers/AppReducer';
import AppWithNavigationState from './components/AppNavigator';
YellowBox.ignoreWarnings(['Setting a timer']);
export default class ReduxExampleApp extends React.Component {
constructor (props) {
super(props);
middleware = [ thunk.withExtraArgument({ emit }) ];
this.store = createStore(AppReducer, applyMiddleware(...middleware));
websocketInit(this.store);
}
render() {
return (
<Provider store={this.store}>
<AppWithNavigationState />
</Provider>
);
}
}