Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 719 Bytes

File metadata and controls

26 lines (19 loc) · 719 Bytes

3.8 산탄총 수술

Untitled

  • 함수 옮기기와 필드 옮기기를 통해 한 모듈로 묶기

  • 어설프게 분리된 로직을 인라인 리팩토링으로 처리해도 좋다.

    • before
    const isLastStep = (step) => step === "4";
    
    const showExistToast = () => {
        const message = isLastStep(step) ? '저장하고 이탈' : '저장하지 않고 이탈';
        toast(message);
    };
    
    • after
    const showExistToast = () => {
        const message = step === "4" ? '저장하고 이탈' : '저장하지 않고 이탈';
        toast(message);
    };