Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vuex, API 추가 #13

Open
ChangJoo-Park opened this issue Mar 6, 2017 · 13 comments
Open

Vuex, API 추가 #13

ChangJoo-Park opened this issue Mar 6, 2017 · 13 comments
Assignees

Comments

@ChangJoo-Park
Copy link
Collaborator

No description provided.

@ChangJoo-Park ChangJoo-Park self-assigned this Mar 6, 2017
@devjin0617
Copy link
Owner

덜덜덜 집이신가요?

ChangJoo-Park added a commit that referenced this issue Mar 6, 2017
@ChangJoo-Park
Copy link
Collaborator Author

네 ㅋㅋ

@ChangJoo-Park
Copy link
Collaborator Author

vuex랑 api 요청, 테스트를 위한 axios, axios-mock 추가했어요

@ChangJoo-Park
Copy link
Collaborator Author

lib에 있던 store 제거하고 vuex 만들어놨어요

@devjin0617
Copy link
Owner

허얼.. 장난 아니네요

@ChangJoo-Park
Copy link
Collaborator Author

할게많네요 이제부터 ㅋㅋ

@devjin0617
Copy link
Owner

네.. 엄청 많아요 덜덜. 잠시 멘탈 흔들렸네요 ㅋㅋㅋㅋ

@jinseongho
Copy link
Collaborator

화이팅

@ChangJoo-Park
Copy link
Collaborator Author

같이하시는건가요

@ChangJoo-Park
Copy link
Collaborator Author

1834a17

범용으로 만드는거라 어디까지할지 딱히 생각이 없어서
vuex를 사용하는 시나리오 추가했습니다 (mock-server용 json-server가 npm run dev실행시 함께 시작합니다

API 테스트용 페이지를 추가했습니다 들어가셔서 확인하시면 되요

페이지 진입 -> vuex에 fetch action 실행 -> productService를 통해 API 요청 -> 결과를 mutation을 이용해 state에 추가 -> 페이지에서 computed로 vuex의 getters를 통해 자동으로 바인딩됨

이렇습니다..

@ChangJoo-Park
Copy link
Collaborator Author

FakeProduct 클래스는 faker를 이용해서 대충 만들었어요 mock-server 디렉터리 보시면 됩니다

@devjin0617
Copy link
Owner

헐... 초고수..... 머리가 딸려서 이해불가네요 덜덜덜덜

@ChangJoo-Park
Copy link
Collaborator Author

product service에 getAll이라 했을거에요 fetchProducts로 해야하는게 맞는거같은데 전 잘 모르니까 그냥 냅둘게요 나중에 얘기해보고 바꾸죠 뭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants