The journey to becoming a developer

My future is created by what I do today, not tomorrow.

What I learned/CodeSquad Log

CodeSquad Day 57 : Front-end Week 7

Millie 2022. 3. 30. 02:12

 

CodeSquad๐Ÿ”นDay 57

Morning Algo

 

Best Time to Buy and Sell Stock - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com

 

์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - 124 ๋‚˜๋ผ์˜ ์ˆซ์ž

 

programmers.co.kr

์˜ค๋Š˜ 9์‹œ ์•„์นจ ์Šคํ„ฐ๋””์—์„œ๋Š” ์œ„์˜ ๋‘ ๋ฌธ์ œ๋ฅผ ๊ฐ€์ง€๊ณ  ์ง„ํ–‰ํ•ด๋ณด์•˜๋‹ค. ๋‚˜๋Š” Two pointer๋ฅผ ํ™œ์šฉํ•ด์„œ LeetCode ๋ฌธ์ œ๋ฅผ ํ’€์–ด๋ณด์•˜๊ณ , 124 ๋‚˜๋ผ์˜ ์ˆซ์ž๋Š” ๋‹ค๋ฅธ ํ’€์ด์˜ ๋„์›€์„ ๋ฐ›์•„ ๊ทœ์น™์„ ์ ์šฉํ•ด์„œ ํ•ด๊ฒฐํ–ˆ๋‹ค.

 

Group Review

์ƒˆ๋กœ์šด ์กฐ์—์„œ์˜ ์ฒซ ๋ฆฌ๋ทฐ์˜€๋‹ค. ๋‚˜๋Š” Store๋ฅผ ๊ตฌํ˜„ํ•˜๋ฉด์„œ ์–ด๋ ค์› ๋˜, json ๋ฐ์ดํ„ฐ๋ฅผ ๋น„๋™๊ธฐ๋กœ ๋ฐ›์•„์˜ค๋Š” ๊ฒƒ์— ๋Œ€ํ•ด์„œ ๋ฆฌ๋ทฐ๋ฅผ ํ–ˆ๋‹ค. ์•จ๋Ÿฐ์€ MVVM ๊ตฌ์กฐ๋กœ ๋ฏธ์…˜์„ ์ง„ํ–‰ํ–ˆ๋Š”๋ฐ, MVVM์— ๋Œ€ํ•œ ์ดํ•ด๊ฐ€ ์•„์ง ๋ถ€์กฑํ•ด์„œ ๊ทธ๋Ÿฐ์ง€ ์ข€ ์–ด๋ ค์› ๋‹ค. ์ด๋ฒˆ์— ์ง€๋‹ˆ, ์•จ๋Ÿฐ๊ณผ ๋ฆฌ๋ทฐ ์กฐ๊ฐ€ ๋˜์—ˆ๋Š”๋ฐ ์ด ๋•Œ ์•จ๋Ÿฐ์˜ ์ฝ”๋“œ๋ฅผ ์œ ์‹ฌํžˆ ๋ณด๋ฉด์„œ ์ดํ•ดํ•ด ๋ด์•ผ๊ฒ ๋‹ค. ๊ธˆ์š”์ผ ํ˜น์€ ์ฃผ๋ง์— ์ง„ํ–‰ํ•  ์˜ˆ์ •์ด๋‹ค.

๋‚œ์ •์€ debounce ํ•จ์ˆ˜๋ฅผ ๊ตฌํ˜„ํ•  ๋•Œ Promise๋ฅผ ์ด์šฉํ–ˆ๋Š”๋ฐ ์ด๊ฒŒ ์ •๋ง ์‹ ๋ฐ•ํ•˜๊ณ  ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค.

 

Talk

์ด๋ˆ„์—๊ฒŒ ์งˆ๋ฌธ

์˜คํ›„ ๋‚ด๋‚ด ๋ง‰ํ˜”๋˜ ๋น„๋™๊ธฐ ๋ฌธ์ œ๋ฅผ ์ด๋ˆ„์—๊ฒŒ ์งˆ๋ฌธํ•ด์„œ ํ•ด๊ฒฐํ–ˆ๋‹ค. setup ํ•จ์ˆ˜๋ฅผ async ํ‚ค์›Œ๋“œ๋ฅผ ๋ถ™์—ฌ ๋น„๋™๊ธฐ๋กœ ๋งŒ๋“ค๊ณ , ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•œ ํ›„ await ํ‚ค์›Œ๋“œ๋ฅผ ์ „์—ญ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์‹์œผ๋กœ ํ•ด๊ฒฐ์„ ํ–ˆ๋‹ค. ๋น„๋™๊ธฐ์˜ ์„ธ๊ณ„๋Š” ์ •๋ง ๋„“์–ด์„œ ๋งŽ์ด ๊ณต๋ถ€๋ฅผ ํ•ด์•ผ ํ•œ๋‹ค.

 

์ œ์ด๋ฏธ & ์นธ

Store๋ฅผ ์™„๋ฒฝํ•˜๊ฒŒ ๊ตฌํ˜„ํ•œ ์ œ์ด๋ฏธ์—๊ฒŒ ์˜ค๋Š˜ ์งˆ๋ฌธ์„ ํ•ด์•ผ๊ฒ ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๊ณ , 12์‹œ ๋ฐ˜์ฏค ์ด์•ผ๊ธฐ๋ฅผ ์‹œ์ž‘ํ–ˆ๋Š”๋ฐ ์ค‘๊ฐ„์— ์นธ๋„ ํ•ฉ๋ฅ˜ํ•ด์„œ 1์‹œ 50๋ถ„์ฏค ์ด์•ผ๊ธฐ๊ฐ€ ๋์ด ๋‚ฌ๋‹ค. MVC ํŒจํ„ด, ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ, ๋‹ค์Œ ์ฃผ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•  ํŒ€ ํ”„๋กœ์ ํŠธ, ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ Deep Dive ์Šคํ„ฐ๋”” ๋“ฑ ๋งŽ์€ ์ด์•ผ๊ธฐ๊ฐ€ ์˜ค๊ฐ”๋‹ค.

์ œ์ด๋ฏธ์˜ ์ฝ”๋“œ๋ฅผ ์ฐธ๊ณ ํ•ด์„œ Store๋ฅผ ์‹œ๋„ํ–ˆ์ง€๋งŒ, ์•„์ง observer๋Š” ์ดํ•ดํ•˜์ง€ ๋ชปํ•ด์„œ ๊ตฌํ˜„ํ•˜์ง€ ๋ชปํ–ˆ๋Š”๋ฐ ๋‚ด์ผ ๋‹ค์‹œ ์‹œ๋„ํ•ด๋ณด๊ณ  PR์„ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผ๊ฒ ๋‹ค.

์ฟ ํŒก ํด๋ก ์„ ํ•˜๋ฉด์„œ ๊ถ๊ธˆํ–ˆ๋˜ ์ ์ด ์žˆ์—ˆ๋‹ค.

์ฟ ํŒก ์‚ฌ์ดํŠธ์—์„œ ๊ฐœ๋ฐœ์ž ๋„๊ตฌ๋ฅผ ์ผœ ๋ณด๋ฉด ์ด๋ฏธ์ง€๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ์ด๋Ÿฐ ์‹์œผ๋กœ ์•„์ด์ฝ˜ ๋“ฑ์„ ๋ญ‰์ณ๋†“๊ณ , ๊ทธ๊ฒƒ์„ position์œผ๋กœ ์œ„์น˜๋ฅผ ์กฐ์ •ํ•ด์„œ ์ž˜๋ผ์„œ ์“ฐ๋Š” ๋ฐฉ์‹์„ ์“ฐ๊ณ  ์žˆ์—ˆ๋‹ค.

 

GitHub - FE-Lex-Kim/-TIL: ์‹ค๋ ฅ์žˆ๋Š” ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋˜๊ธฐ ์œ„ํ•œ TIL

์‹ค๋ ฅ์žˆ๋Š” ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋˜๊ธฐ ์œ„ํ•œ TIL. Contribute to FE-Lex-Kim/-TIL development by creating an account on GitHub.

github.com

์ œ์ด๋ฏธ๊ฐ€ ์•Œ๋ ค์คฌ๋Š”๋ฐ ์ด๊ฒŒ ์•Œ๊ณ ๋ณด๋‹ˆ ๊ธฐ๋ฒ•์ด์—ˆ๋‹ค. ๋ฐ”๋กœ IS, Image Sprite๋ผ๋Š” ๊ฒƒ์ด๋‹ค. ์œ„์™€ ๊ฐ™์ด ์—ฌ๋Ÿฌ ์ด๋ฏธ์ง€ ์‚ฌ์ง„์„ ์‚ฌ์ง„๋งˆ๋‹ค ๊ฐ๊ฐ ๋ณด๋‚ด์ง€ ์•Š๊ณ , ํ•˜๋‚˜์˜ ํฐ ์ด๋ฏธ์ง€์— ๋ชจ๋“  ์ด๋ฏธ์ง€๋ฅผ ํ•ฉ์ณ๋†“๊ฒŒ ๋˜๋ฉด ์„œ๋ฒ„๋กœ ์š”์ฒญํ•˜๋Š” ํšŸ์ˆ˜๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ๊ฒŒ ๋œ๋‹ค. ์ด๊ฒƒ์€ ์›น ํŽ˜์ด์ง€์˜ ์ฒซ ๋กœ๋”ฉ ์†๋„๋ฅผ ์ค„์—ฌ์ค„ ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•œ๋‹ค.

 


์˜ค๋Š˜์€ ํ•œ ๊ฐ€์ง€ ์ƒˆ๋กœ์šด ์‹œ๋„๋ฅผ ํ•œ ๋‚ ์ด์—ˆ๋‹ค. ๋ฐ”๋กœ ์ด๋ ฅ์„œ๋ฅผ ์ž‘์„ฑํ•ด ๋ณธ ๊ฒƒ์ด๋‹ค. ์ƒ๊ฐ๋งŒ ํ•˜๊ณ  ์žˆ๋˜ ์ด๋ ฅ์„œ๋ฅผ ์˜ค๋Š˜ Notion์„ ํ™œ์šฉํ•ด์„œ ๋งŒ๋“ค์–ด ๋ณด์•˜๋‹ค. ๊ทธ๋™์•ˆ ๊ฐœ๋ฐœ ๊ณต๋ถ€๋ฅผ ํ•ด ์˜ค๋ฉด์„œ ๋‚ด๊ฐ€ ํ–ˆ๋˜ ํ”„๋กœ์ ํŠธ๋“ค์„ ์ •๋ฆฌํ•ด ๋ณด๋‹ˆ ์•„์ง ๋‚ด๊ฐ€ ๋” ์Œ“์•„์•ผ ํ•˜๋Š” ์—ญ๋Ÿ‰์ด ํ›จ์”ฌ ๋งŽ๋‹ค๋Š” ๊ฒŒ ๋Š๊ปด์กŒ๋‹ค. ๊ธฐํšŒ๊ฐ€ ๋œ๋‹ค๋ฉด ํ”ผ๋“œ๋ฐฑ๋„ ๋ฐ›๊ณ , ๋” ๋‚˜์€ ์ด๋ ฅ์„œ๋ฅผ ๋งŒ๋“ค์–ด ๋‚˜๊ฐ€๊ณ  ์‹ถ๋‹ค.

๋˜ ์•ž์œผ๋กœ๋Š” ์ข€ ๋” ํ’๋ถ€ํ•œ ํšŒ๊ณ ๋ฅผ ์“ฐ๋„๋ก ๋…ธ๋ ฅํ•  ๊ฒƒ์ธ๋ฐ, ํŠนํžˆ๋‚˜ ์ฃผ๋ง์— ์“ฐ๋Š” ํšŒ๊ณ ๋Š” ์‹œ๊ฐ„์„ 1์‹œ๊ฐ„ ์ •๋„ ํˆฌ์žํ•ด์„œ ํ•œ ์ฃผ๋ฅผ ์ž˜ ๋˜๋Œ์•„๋ณด๊ณ , ๋‹ค์Œ ์ฃผ์— ๋” ๋ฐœ์ „ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋ ค๊ณ  ํ•œ๋‹ค. ํšŒ๊ณ ๋ฅผ ์„ฑ์žฅ์˜ ๋ฐœํŒ์œผ๋กœ ์‚ผ์•„์•ผ๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ์ด ๋งŽ์ด ๋“ ๋‹ค.

'What I learned > CodeSquad Log' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

CodeSquad Day 59 : Front-end Week 7  (0) 2022.04.01
CodeSquad Day 58 : Front-end Week 7  (0) 2022.03.31
CodeSquad Day 56 : Front-end Week 7  (0) 2022.03.29
CodeSquad Day 55 : Front-end Week 6  (0) 2022.03.26
CodeSquad Day 54 : Front-end Week 6  (0) 2022.03.25