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.

fix typing

+14 -8
+2 -2
src/renderer/actions/deviceActions.ts
··· 1 1 import { createAction } from '@reduxjs/toolkit'; 2 2 import { ActionType } from 'typesafe-actions'; 3 - import { DEVICE_AVAILABILITY, CONNECTION_STATUS } from '../constants/constants'; 3 + import { DEVICES, DEVICE_AVAILABILITY, CONNECTION_STATUS } from '../constants/constants'; 4 4 import { Device, DeviceInfo } from '../constants/interfaces'; 5 5 6 6 // ------------------------------------------------------------------------- ··· 26 26 'SET_AVAILABLE_DEVICES' 27 27 ), 28 28 DeviceFound: createAction<Device[], 'DEVICE_FOUND'>('DEVICE_FOUND'), 29 - SetDeviceType: createAction<string, 'SET_DEVICE_TYPE'>('SET_DEVICE_TYPE'), 29 + SetDeviceType: createAction<DEVICES, 'SET_DEVICE_TYPE'>('SET_DEVICE_TYPE'), 30 30 // eslint-disable-next-line @typescript-eslint/no-explicit-any 31 31 SetRawObservable: createAction<any, 'SET_RAW_OBSERVABLE'>( 32 32 // RxJS Observable from BLE device — no stable generic type available
+2 -1
src/renderer/containers/AnalyzeContainer.ts
··· 2 2 import { connect } from 'react-redux'; 3 3 import Analyze from '../components/AnalyzeComponent'; 4 4 import { PyodideActions, ExperimentActions } from '../actions'; 5 + import { RootState } from '../store'; 5 6 6 - function mapStateToProps(state) { 7 + function mapStateToProps(state: RootState) { 7 8 return { 8 9 title: state.experiment.title, 9 10 type: state.experiment.type,
+2 -1
src/renderer/containers/CleanContainer.ts
··· 2 2 import { connect } from 'react-redux'; 3 3 import CleanComponent from '../components/CleanComponent'; 4 4 import { PyodideActions, ExperimentActions } from '../actions'; 5 + import { RootState } from '../store'; 5 6 6 - function mapStateToProps(state) { 7 + function mapStateToProps(state: RootState) { 7 8 return { 8 9 type: state.experiment.type, 9 10 title: state.experiment.title,
+2 -1
src/renderer/containers/CollectContainer.ts
··· 2 2 import { connect } from 'react-redux'; 3 3 import Collect from '../components/CollectComponent'; 4 4 import { DeviceActions, ExperimentActions } from '../actions'; 5 + import { RootState } from '../store'; 5 6 6 - function mapStateToProps(state) { 7 + function mapStateToProps(state: RootState) { 7 8 return { 8 9 ...state.device, 9 10 ...state.experiment,
+2 -2
src/renderer/epics/experimentEpics.ts
··· 175 175 filter(isActionOf(RouterActions.RouteChanged)), 176 176 map((action) => action.payload as string), 177 177 filter((pathname) => pathname !== '/' && pathname !== '/home'), 178 - map(ExperimentActions.SaveWorkspace) 178 + map(() => ExperimentActions.SaveWorkspace()) 179 179 ); 180 180 181 181 const saveWorkspaceEpic: Epic< ··· 212 212 tap((action) => console.log('navigation', action.payload)), 213 213 map((action) => action.payload as string), 214 214 filter((pathname) => pathname === '/' || pathname === '/home'), 215 - map(ExperimentActions.ExperimentCleanup) 215 + map(() => ExperimentActions.ExperimentCleanup()) 216 216 ); 217 217 218 218 export default combineEpics(
+4 -1
src/renderer/reducers/deviceReducer.ts
··· 37 37 38 38 export default createReducer(initialState, (builder) => 39 39 builder 40 - .addCase(DeviceActions.ConnectToDevice, (state, action) => { 40 + .addCase(DeviceActions.ConnectToDevice, (state) => { 41 + return state; 42 + }) 43 + .addCase(DeviceActions.SetDeviceType, (state, action) => { 41 44 return { 42 45 ...state, 43 46 deviceType: action.payload,