sensor detail item
This commit is contained in:
parent
a24b0a49cb
commit
d5ca790290
|
@ -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';
|
||||
|
||||
|
|
|
@ -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;
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
16
src/ts/@overflow/sensor/redux/state/ItemReadAllBySensor.ts
Normal file
16
src/ts/@overflow/sensor/redux/state/ItemReadAllBySensor.ts
Normal 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;
|
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* Created by geek on 17. 7. 3.
|
||||
*/
|
Loading…
Reference in New Issue
Block a user