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

console.log 숙청 및 e, err을 모두 error로 통합 #190

Merged
merged 2 commits into from
Feb 15, 2022
Merged

Conversation

SeojinSeojin
Copy link
Member

⛓ Related Issues

📋 작업 내용

  • console.log 숙청. 디버깅 때 편할 것 같은 친구들은 console.error로 바꿈!!
  • e, err이라는 변수명을 모두 error으로 바꿈..

📌 PR Point

  • 젼언니가 is defined but not used때문에 console.log를 지울 수 없었다고 했는데, 사실 맘껏 지워도 되는 친구였어~!

API 인터페이스가 정의될 때
@api/neoga.ts

interface NeogaService {
  ...
  postCreateForm(formID: number): Promise<{ isCreated: boolean; q: string }>;
  ...
}

이렇게 postCreateForm은 formID를 매개변수로 받아야 하는 함수이지만,
매개변수로 아무것도 안 받는 함수도 저 친구의 타입을 덮어쓸 수 있어!! 그래서
@infrastructure/remote/mock.ts

  const postCreateForm = async () => {
    await wait(2000);
    return { isCreated: true, q: '큐' };
  };

이런 식으로 매개변수를 지워버려도 에러가 안 난다!!
따라서 다음부턴 맘껏 지워주어도 돼~

@SeojinSeojin SeojinSeojin added the chore 🍣 기능 개발 외 부수적인 일들 label Feb 11, 2022
@SeojinSeojin SeojinSeojin self-assigned this Feb 11, 2022
@SeojinSeojin
Copy link
Member Author

울 웹쁜이 고생많았어 ! 여기서 미리보기로 보면서 쉬어~ 다른 웹쁜이들한테도 자랑해줘~

Copy link
Member

@NamJwong NamJwong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변수명 통일해준 것도 너무 좋고, 매개변수 관련 지식도 알게 돼서 좋았습니다 ! ! ! b

@@ -42,8 +42,7 @@ export function neogaDataMock(): NeogaService {
return { isSuccess: true };
};

const postCreateForm = async (formID: number) => {
console.log(formID);
const postCreateForm = async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

박박.. 타입 선언하고 실제로 만들 때 매개변수를 꼭 다 입력하지 않아도 되는구나 자스 함수 선언하고 사용할 때 매개변수 넣는 규칙이랑 비슷하네!

type funcType1 = (num: number) => void;
const func1: funcType1 = () => {
    console.log('test');
}

type funcType2 = (num: number, str: string) => void;
const func2: funcType2 = (num: number) => {
    console.log(num);
}
const func2_1: funcType2 = (str: string) => { // 에러 남 !
    console.log(str);
}

type funcType3 = () => void;
const func3: funcType3 = (num: number) => { // 에러 남 !
    console.log(num);
}

Copy link
Member

@100Gyeon 100Gyeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 매개변수를 지울 생각도 못 했다 ..!! 버려도 에러가 안 난다 명심..
신경 쓰였던 부분들 다 해결해 줘서 고마워 ㅎㅎ

@SeojinSeojin SeojinSeojin merged commit 1978cf7 into dev Feb 15, 2022
@SeojinSeojin SeojinSeojin deleted the feat/#189 branch February 15, 2022 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore 🍣 기능 개발 외 부수적인 일들
Projects
None yet
Development

Successfully merging this pull request may close these issues.

console.log 숙청하기
3 participants