📚 1. 사전 지식 참고 링크 : React Query, Custom Hook, React-query에 Typescript 적용하기 React Query란? React Query는 서버의 값을 클라이언트에 가져오거나, 캐싱, 값 업데이트, 에러핸들링 등 비동기 과정을 더욱 편하게 하는 데 사용된다. React Query의 장점으로는, 아래의 구현하기 귀찮은 일들을 대신 수행한다. 캐싱 get을 한 데이터에 대해 update를 하면 자동으로 get을 다시 수행한다. (예를 들면 게시판의 글을 가져왔을 때 게시판의 글을 생성하면 게시판 글을 get 하는 api를 자동으로 실행 ) 데이터가 오래 되었다고 판단되면 다시 get (invalidateQueries) 동일 데이터 여러번 요청하면 한 번만 요청한다. ..
📙 1. 문제 Link : https://leetcode.com/problems/reverse-integer/description/ 문제 설명 Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned). 제한 사항 2 ≤ weights의 길이 ≤ 100,000 100 ≤ weights[i] ≤ ..
📚 1. 사전 지식 JWT란? JWT(Json Web Token) : Json 포맷을 이용하여 사용자에 대한 속성을 저장하는 Claim 기반의 Web Token 토큰 자체를 정보로 사용하는 Self-Contained 방식으로 정보를 안전하게 전달 주로 회원 인증이나 정보 전달에 사용되는 JWT는 아래의 로직을 따라서 처리 애플리케이션이 실행될 때, JWT를 static변수와 localStorage에 저장한다. static변수에 저장하는 이유는 HTTP통신을 할 때마다 JWT를 HTTP헤더에 담아서 보내야 하는데, localStorage에서 계속 불러오면 overhead가 발생하기 때문이다. 클라이언트에서 JWT를 포함해 요청을 보내면 서버는 허가된 JWT를 검사한다. 또한, 로그아웃을 할 경우 local..
💭 1. 이번 주엔 어떤 일들이 있었고, 그 속에서 나는 어떤 것을 느꼈을까 4월 2일(일) 📜 오늘도 CS공부 CS공부 복습과 함께, 프런트엔드 개발 면접에서 물어보는 질문들 위주로 공부했다. 핵심 1. 일급 객체 : JS에서 특별한 대우 받는 것들. 그중 하나가 함수 : 변수에 할당 & 인자로 전달 & 결과로 리턴 2. 고차 함수 : 인자로 전달하거나, 결과로 리턴하는 함수 (일급 객체의 일부) 3. var은 함수 레벨 스코프(호이스팅 O->선언되기도 전에 undefined) const, let은 블록레벨 스코프 지원 가지가 흔들리지 않게 뿌리를 깊이 심자 4월 3일(월) 📜 프리온보딩 프론트엔드 챌린지 4월 오늘의 강의의 메인 주제는 VirtualDOM이었다. VirtualDOM과 그 외의 유용한 ..
📙 1. 문제 Link : https://leetcode.com/problems/zigzag-conversion/description/ 문제 설명 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y I R And then read line by line: "PAHNAPLSIIGYIR" Write the code that will take a string and make this conversion given ..
1. 문제 : Longest Substring Without Repeating Characters 문제 설명 Given a string s, find the length of the longest substring without repeating characters. 제한 사항 0 =now){ now = st.lastIndexOf(it)+1; } st.push(it); }else{ st.push(it); } arr.push(st.length-now); }) return Math.max(...arr) }; s를 순환을 하며 st에 하나씩 집어 넣었다. 그리고 now라는 변수를 만들어, 문자가 곂치지 않는 마지노선을 정의하였다. => arr.push(st.length-now)로 값을 arr에 추가하였다. ..
1. 문제 : Add Two Numbers 문제 설명 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. 제한 사항 The number of nodes in each linked list is ..