[1031] 서치라이트 26일차

한별·2024년 11월 30일
0

서치라이트

목록 보기
28/40

Today's Tasks

Learnings and Questions

axios query parameter

코드 리뷰에서 배운 것..!

  • 기존 코드 : limit 존재 여부에 따라 uri에 query parameter를 문자열로 넣어줌 (삼항 연산자)
getPostList = async ({ limit }: ParamType = {}) => {
   const response = await this.axios.get<ResponseType<PostType[]>>(
   `${this.baseUrl}${limit ? `?limit=${limit}` : ''}`,);
      return response.data;
   };
  • 수정 코드 : axios get 함수의 parameter로 param 객체를 넣어줌 -> 깔꼼! 😍
  getPostList = async (params: ParamType = {}) => {
    const response = await this.axios.get<ResponseType<PostType[]>>(
      `${this.baseUrl}`,
      { params },
    );
    return response.data;
  };

CDN = Content Delivery Network

서버가 멀리 있을 수록 전파 지연 (propagation delay)에 의해 응답이 늦어진다. 따라서, 컨텐츠를 가장 가까운 서버에서 받아오는 캐싱으로 속도를 줄이는 것이다.

반응형 swiper

모바일 / 태블릿 / 데스크탑 별 swiper 한 페이지 당 컨텐츠 개수가 달랐다.
직접 구현해야하는 줄 알고 머리 싸매고 있었는데, breakpoints라는 props가 있었음..!

param-breakpoints | swiperjs

Plan for Tomorrow

  • KAN-195 - 2차 피드백 반영 시작
  • KAN-188 - CI/CD 신규 구성 시작
profile
누구나 이해하기 쉽게 글 쓰고 싶은 FE 개발자

0개의 댓글

관련 채용 정보