sensor detail item

This commit is contained in:
snoop 2017-08-10 19:24:02 +09:00
parent a24b0a49cb
commit d5ca790290
5 changed files with 44 additions and 6 deletions

View File

@ -9,6 +9,7 @@ import readProbeReducer from '@overflow/probe/redux/reducer/read';
import readAllByTargetReducer from '@overflow/sensor/redux/reducer/read_all_by_target';
import SensorReadReducer from '@overflow/sensor/redux/reducer/read';
import SensorItemReadAllBySensorReducer from '@overflow/sensor/redux/reducer/item_read_all_by_sensor';
import AsyncRequest from '@overflow/app/redux/saga/AsyncRequest';

View File

@ -0,0 +1,27 @@
/**
* Created by geek on 17. 7. 3.
*/
import Action from '@overflow/commons/redux/Action';
import { ReducersMapObject } from 'redux';
import SensorItem from '@overflow/sensor/api/model/SensorItem';
import * as ItemReadAllBySensorActionTypes from '../action/item_read_all_by_sensor';
import ItemReadAllBySensorState, { defaultState as itemReadAllBySensorDefaultState } from '../state/ItemReadAllBySensor';
const reducer: ReducersMapObject = {
[ItemReadAllBySensorActionTypes.REQUEST_SUCCESS]:
(state: ItemReadAllBySensorState = itemReadAllBySensorDefaultState, action: Action<SensorItem>): ItemReadAllBySensorState => {
console.log(action);
return {
...state,
SensorItemList:<SensorItem[]>action.payload,
};
},
[ItemReadAllBySensorActionTypes.REQUEST_FAILURE]:
(state: ItemReadAllBySensorState = itemReadAllBySensorDefaultState, action: Action<Error>): ItemReadAllBySensorState => {
return state;
},
};
export default reducer;

View File

@ -1,3 +0,0 @@
/**
* Created by geek on 17. 7. 3.
*/

View File

@ -0,0 +1,16 @@
/**
* Created by geek on 17. 7. 3.
*/
import SensorItem from '../../api/model/SensorItem';
export interface State {
readonly SensorItemList: SensorItem[];
readonly error?: Error;
}
export const defaultState: State = {
SensorItemList: undefined,
error: undefined,
};
export default State;

View File

@ -1,3 +0,0 @@
/**
* Created by geek on 17. 7. 3.
*/