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_ . * CLIENT_ .
* (ex. ) LOG로 .
* *
* *
* - GET_[]_LIST * - GET_[]_LIST
@ -15,12 +14,16 @@ import { createAsyncAction, ActionType, createAction } from 'typesafe-actions';
* / - UPDATE_[] * / - UPDATE_[]
* - DELETE_[] * - DELETE_[]
* *
* []
* SET, FIND, SEND, CHECK, REGISTER ...
* []
* LIST, DETAIL, LOG, APPROVAL ...
*
* *
* [Action ] * [Action ]
* . * .
* Action . (Ex. GET_DRONE_LIST_REQUEST -> getDroneList) * 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 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( export const getDroneList = createAsyncAction(
GET_DRONE_LIST_REQUEST, GET_DRONE_LIST_REQUEST,
@ -43,7 +46,7 @@ export const getDroneList = createAsyncAction(
GET_DRONE_LIST_FAILURE GET_DRONE_LIST_FAILURE
)(); )();
export const mapType = createAction(DISPATCH_MAPTYPE)(); export const clientMapType = createAction(CLIENT_MAPTYPE)();
const actions = { const actions = {
getDroneList getDroneList

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

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

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

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

Loading…
Cancel
Save