분류 전체보기
-
[항해 99 주특기] Throttiling && Debouncing && Lodash개발일지/항해 99 2023. 7. 10. 00:31
스로틀링 스로틀링이란 어떠한 이벤트를 연속적으로 눌렀을 때 그 이벤트의 결과로 인해 리랜더링이 모두 일어나게 된다면 부하가 굉장히 높아지게 되는데 이러한 과부화를 막기 위해서 사용할 수 있는 기법으로써 가장 쉬운 예로 좋아요 버튼을 엄청나게 누르는 케이스가 있을텐데 그때마다 서버에 데이터를 갱신해달라는 요청을 보낸다면 많은 부하가 생길 것 이러한 상황에서 쓸 수 있는 기법이다. 즉 과도한 이벤트 핸들러 호출을 방지하는 기법이다. 실제로 사용해보면서 이해하는 것이 가장 쉽기 때문에 실습을 병행하면서 이해를 해보았다. setTimeout을 통해서 원리를 이해해보자 (JS문법에서만 쓰이는 것이 아니기 때문에 잘 알아두면 좋다) 아래 3가지는 스로틀링의 예시이다. 개념적으로는 3가지 기법이 있다 시작할 때, 끝..
-
[항해 99 WIL] Life cycle && React Hooks개발일지/항해 99 2023. 7. 10. 00:22
Life cycle 생명주기라고도 불리는 이것은 컴포넌트가 생성되는 순간부터 사라지는 순간까지의 과정에서 어떠한 메서드가 실행이 되는지를 알 수 있는 것으로 클래스형컴포넌트를 많이 사용하는 그떄에는 필수적으로 알고있어야하지만 현재는 함수형컴포넌트가 대중화가 되고 클래스형 컴포넌트의 사용이 줄어들어 자세하게는 알 필요가 없다고 생각이 든다. 하지만 그중에서도 3가지는 알아야하는데 그게 마운트, 업데이트, 언마운트이다. 마운트 컴포넌트가 생성이 되었을 때를 나타내는 것으로 페이지가 랜더링되는것과 함수가 생성 및 실행되는 것이 모두 여기 담겨있다고 보면 된다 업데이트 state의 변화 props의 변화로 그리고 강제 업데이트로 인해서 리랜더링이 되었을때를 나타내는 것이라고 보면 된다 언마운트 함수가 사라졌을 ..
-
[항해99 회고록] 3주차 주특기 Level-3 과제개발일지/항해 99 2023. 7. 8. 11:34
이번 level3과제는 재활용할 수 있는 컴포넌트 만들기가 주제인듯하다. 그래서 좀 더 아쉬움이 많이 남는다. 먼저 혜경님과 페어가 되어서 진행을 하게 되었는데 많이 잘 이끌어주셔서 너무 고마웠다. 부족했던 점 css를 사용하는 부분에서 혜경님의 도움을 많이 받아서 조금 수월하게 진행을 할 수 있었다. 기술적으로 자문을 많이구해서 조금 귀찮아하셨을까 걱정이였지만 다행이도 티는 내지 않으셨다..ㅎ 컴포넌트 재활용의 개념에 대해서 이해가 조금 부족한 것같다 props를 전달하는 과정에서 조금 간소화를 시키고 공통된 부분을 모아서 구성해야하는데 이부분에 대해서 이해가 좀 덜 되서 모달창을 만들 때 특히나 갈피를 잘 못잡은 것 같다. git사용부분에 있어서 처음에 많은 시행착오를 거치게 되어버려서 시간을 많이 ..