From 437f124d2c1585468b4da23b97caa170569bf293 Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 20 Jul 2017 16:53:07 +0900 Subject: [PATCH] changed props --- src/ts/@overflow/sensor/react/SensorList.tsx | 15 ++++----------- .../sensor/react/components/SensorList.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/ts/@overflow/sensor/react/SensorList.tsx b/src/ts/@overflow/sensor/react/SensorList.tsx index 6a46d44..86f6ac0 100644 --- a/src/ts/@overflow/sensor/react/SensorList.tsx +++ b/src/ts/@overflow/sensor/react/SensorList.tsx @@ -1,8 +1,8 @@ import { connect, Dispatch } from 'react-redux'; import { SensorList, - Props as SensorListProps, - State as SensorListState, + StateProps as SensorListStateProps, + DispatchProps as SensorListDispatchProps, } from './components/SensorList'; import State from '../redux/state/ReadAllByTarget'; @@ -10,19 +10,12 @@ import * as ReadAllByTargetActions from '../redux/action/read_all_by_target'; import Target from '@overflow/target/api/model/Target'; import Sensor from '@overflow/sensor/api/model/Sensor'; -export function mapStateToProps(state: any): SensorListProps { +export function mapStateToProps(state: any): SensorListStateProps { return { }; } -// const mapDispatchToProps = (dispatch: Dispatch) => ({ -// onReadAllByTarget: (target: Target) => { -// dispatch(ReadAllByTargetActions.request(target)); -// }, -// }); - - -export function mapDispatchToProps(dispatch: Dispatch): SensorListProps { +export function mapDispatchToProps(dispatch: Dispatch): SensorListDispatchProps { return { onReadAllByTarget: (target: Target) => { dispatch(ReadAllByTargetActions.request(target)); diff --git a/src/ts/@overflow/sensor/react/components/SensorList.tsx b/src/ts/@overflow/sensor/react/components/SensorList.tsx index 4529655..52bce85 100644 --- a/src/ts/@overflow/sensor/react/components/SensorList.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorList.tsx @@ -6,11 +6,16 @@ import Probe from '@overflow/probe/api/model/Probe'; import Sensor from '@overflow/sensor/api/model/Sensor'; import Target from '@overflow/target/api/model/Target'; -export interface Props { +export interface StateProps { target?: Target; +} + +export interface DispatchProps { onReadAllByTarget?(target: Target): void; } +export type Props = StateProps & DispatchProps; + export interface State { isDetail: boolean; selected: Sensor;