Browse Source

[Redux] 샘플 데이터 수정

master
junh_eee(이준희) 8 months ago
parent
commit
4b591027d6
  1. 19
      src/modules/_sample/actions/index.ts
  2. 11
      src/modules/_sample/models/index.ts
  3. 3
      src/modules/_sample/sagas/index.ts

19
src/modules/_sample/actions/index.ts

@ -5,8 +5,7 @@ import { createAsyncAction, ActionType, createAction } from 'typesafe-actions';
* _를 .
* .
* .
* DISPATCH_ .
* (ex. ) LOG로 .
* CLIENT_ .
*
*
* - GET_[]_LIST
@ -15,12 +14,16 @@ import { createAsyncAction, ActionType, createAction } from 'typesafe-actions';
* / - UPDATE_[]
* - DELETE_[]
*
* []
* SET, FIND, SEND, CHECK, REGISTER ...
* []
* LIST, DETAIL, LOG, APPROVAL ...
*
*
* [Action ]
* .
* Action . (Ex. GET_DRONE_LIST_REQUEST -> getDroneList)
* Action .. dispatch.. ? ..
* createAction을 .
*
*/
// 드론 목록
@ -29,13 +32,13 @@ const GET_DRONE_LIST_SUCCESS = 'sample/GET_DRONE_LIST_SUCCESS';
const GET_DRONE_LIST_FAILURE = 'sample/GET_DRONE_LIST_FAILURE';
// 지도 타입
const DISPATCH_MAPTYPE = 'sample/DISPATCH_MAPTYPE';
const CLIENT_MAPTYPE = 'sample/CLIENT_MAPTYPE';
// 비행 이력 목록
const HISTORY_LIST_REQUEST = 'sample/HISTORY_LIST_REQUEST';
const GET_HISTORY_LIST_REQUEST = 'sample/HISTORY_LIST_REQUEST';
// 비행 이력 상세 목록
const HISTORY_LOG_REQUEST = 'sample/HISTORY_LOG_REQUEST';
const GET_HISTORY_LOG_REQUEST = 'sample/HISTORY_LOG_REQUEST';
export const getDroneList = createAsyncAction(
GET_DRONE_LIST_REQUEST,
@ -43,7 +46,7 @@ export const getDroneList = createAsyncAction(
GET_DRONE_LIST_FAILURE
)();
export const mapType = createAction(DISPATCH_MAPTYPE)();
export const clientMapType = createAction(CLIENT_MAPTYPE)();
const actions = {
getDroneList

11
src/modules/_sample/models/index.ts

@ -1,22 +1,23 @@
/**
* interface는 .
* Interface는 I를 .
* Rq, Rs interface의 Action명 + Rq or Rs를 .
*
* init + .
* interface는 State로 .
*/
export const initSample: SampleState = {
export const initSample: ISampleState = {
droneList: undefined,
droneCount: 0
};
export interface SampleState {
droneList: Drone[] | undefined;
export interface ISampleState {
droneList: IDrone[] | undefined;
droneCount: number | 0;
}
export interface Drone {
export interface IDrone {
groupId: string;
arcrftSno: number;
arcrftHght: number;
@ -26,4 +27,4 @@ export interface Drone {
arcrftWdth: number;
}
export interface UpdateDroneRq {}
export interface IUpdateDroneRq {}

3
src/modules/_sample/sagas/index.ts

@ -13,6 +13,9 @@ function* getDroneListSaga(
} catch (error: any) {}
}
/**
* export saga .
*/
export function* sampleSaga() {
yield takeEvery(Actions.getDroneList.request, getDroneListSaga);
}

Loading…
Cancel
Save