An easy-to-use platform for EEG experimentation in the classroom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 34 lines 1.1 kB view raw
1import React from 'react'; 2import { connect } from 'react-redux'; 3import { bindActionCreators } from 'redux'; 4import { useNavigate } from 'react-router-dom'; 5import Home from '../components/HomeComponent'; 6import { DeviceActions, ExperimentActions, PyodideActions } from '../actions'; 7import { RootState } from '../store'; 8 9function mapStateToProps(state: RootState) { 10 return { 11 ...state.device, 12 ...state.pyodide, 13 connectedDevice: state.device.connectedDevice ?? {}, 14 topoPlot: state.pyodide.topoPlot ?? {}, 15 signalQualityObservable: state.device.signalQualityObservable ?? undefined, 16 }; 17} 18 19function mapDispatchToProps(dispatch) { 20 return { 21 DeviceActions: bindActionCreators(DeviceActions, dispatch), 22 PyodideActions: bindActionCreators(PyodideActions, dispatch), 23 ExperimentActions: bindActionCreators(ExperimentActions, dispatch), 24 }; 25} 26 27const ConnectedHome = connect(mapStateToProps, mapDispatchToProps)(Home); 28 29function HomeContainer(props: Record<string, unknown>) { 30 const navigate = useNavigate(); 31 return React.createElement(ConnectedHome, { ...props, navigate }); 32} 33 34export default HomeContainer;