mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-11 18:32:50 +00:00
handling sensors with redux
This commit is contained in:
@@ -9,7 +9,8 @@ import {connect, Provider} from 'react-redux';
|
||||
import store, {history} from './redux/store';
|
||||
|
||||
//import actions
|
||||
import * as actions from './redux/actions';
|
||||
import * as appActions from './redux/actions/app';
|
||||
import * as sensorActions from './redux/actions/sensor';
|
||||
|
||||
import Index from './pages/Index';
|
||||
import Preview from './components/Preview';
|
||||
@@ -18,13 +19,15 @@ import SensorInfo from './components/sensors/SensorInfo';
|
||||
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
redux: state.reducer
|
||||
app: state.app,
|
||||
sensor: state.sensor
|
||||
}
|
||||
}
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return {
|
||||
actions: bindActionCreators(actions, dispatch)
|
||||
appActions: bindActionCreators(appActions, dispatch),
|
||||
sensorActions: bindActionCreators(sensorActions, dispatch)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user