
이전 글들 중 유지보수가 편리한 코드를 만드는 강좌의 정리글을 올린적이 있다. 내가 구현한 코드를 보던 중 너무 의존성이 강하게 묶여있는 코드를 발견해 이를 리팩토링 하는 기록을 남기고자 한다. 코드 const ShowPosition = ({ positions, tyleInfoSetFun, operatorImgData }: positionsInterface) => { const ePositions = positions.map(e => e.ePosition); // 객체형으로 선택됬는지 여부를 보관하기 const [selectedState, setSelectedState] = useState({ position: { duelist: false, recon: false, sentinels: false, co..