Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skrf 146 local storage #21

Merged
merged 3 commits into from
Oct 25, 2023
Merged

Skrf 146 local storage #21

merged 3 commits into from
Oct 25, 2023

Conversation

hyesung99
Copy link
Collaborator

๐Ÿ“์š”๊ตฌ์‚ฌํ•ญ๊ณผ ๊ตฌํ˜„๋‚ด์šฉ

  • ๋กœ์ปฌ ์Šคํ† ๋ฆฌ์ง€ ํ‚ค๊ฐ’ ์ƒ์ˆ˜ ์ €์žฅ
  • ๋กœ์ปฌ ์Šคํ† ๋ฆฌ์ง€ ๊ด€๋ จ ํ•จ์ˆ˜ ์ถ”๊ฐ€ (getStorage,setStorage,deleteStorage)

โœจprํฌ์ธํŠธ & ๊ถ๊ธˆํ•œ ์ 

getStorage๊ฐ€ storage๋ฅผ ์–ป๋Š”๋‹ค? ๋ผ๋Š” ๋Š๋‚Œ์„ ์ค„ ์ˆ˜๋„ ์žˆ์„๊ฒƒ ๊ฐ™์•„์„œ getFromStorage๊ฐ™์€ ๋ณ€์ˆ˜๋ช…์œผ๋กœ ๋ฐ”๊ฟ€๊นŒ ๊ณ ๋ฏผ์ค‘์ž„๋‹ค

@hyesung99 hyesung99 self-assigned this Oct 25, 2023
colorkite10
colorkite10 previously approved these changes Oct 25, 2023
Copy link
Collaborator

@colorkite10 colorkite10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค! :)

}
};

export { getStorage, setStorage, deleteStorage };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์—๋Ÿฌ๋ฉ”์‹œ์ง€์˜ ๋‚ด์šฉ์ด๋‚˜ ์—๋Ÿฌ์ฒ˜๋ฆฌ๋Š” ์ž„์‹œ์ธ๊ฐ€์š”? ์‚ฌ์šฉ์ž์ž…์žฅ์—์„œ๋Š” ๋‚ด์šฉ์„ ์ดํ•ดํ•˜๊ธฐ ์–ด๋ ค์šธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์—๋Ÿฌ๋ฉ”์‹œ์ง€๋Š” ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค! ์ง€๊ธˆ์€ ๋‹จ์ˆœํžˆ ์—๋Ÿฌ๋ฅผ throwํ–ˆ์Šต๋‹ˆ๋‹ค getStorage๋ฅผ UI๋ ˆ์ด์–ด์—์„œ ํ˜ธ์ถœ์‹œ ์—๋Ÿฌ๋ฅผ ์ฒ˜๋ฆฌํ• ์ˆ˜ ์žˆ๊ฒŒ์š”..!
๊ฑฐ๊ธฐ์„œ๋Š” ์‚ฌ์šฉ์ž๋ฅผ ์œ„ํ•œ ์—๋Ÿฌ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ• ๊ฒƒ ๊ฐ™๋„ค์š”.. toast๋ฅผ ๋„์šด๋‹ค๋˜์ง€, ์—๋Ÿฌ ํŽ˜์ด์ง€๋ฅผ ๋ณด์—ฌ์ค€๋‹ค๋˜์ง€?
์•„๋‹ˆ๋ฉด ์ปค์Šคํ…€ ์—๋Ÿฌ๋ฅผ ๋ฐœ์ƒ์‹œ์ผœ์„œ ๊ณตํ†ต์ ์ธ ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์ค„์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค!

SongInjae
SongInjae previously approved these changes Oct 25, 2023
Copy link
Collaborator

@SongInjae SongInjae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค:)

const getStorage = <T>(key: StorageKeys): T => {
try {
const jsonValue = localStorage.getItem(key);
return jsonValue ? JSON.parse(jsonValue) : null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5: setStorage์™€ getStorage์—์„œ ๊ฐ Value๊ฐ’์„ ๋„ฃ์–ด์ค„ ๋•Œ, ๊ฐ value๋‚˜ key๊ฐ€ ์—†์œผ๋ฉด ์ž๋™์œผ๋กœ catch๋ฌธ์œผ๋กœ ๊ฐ€๋‹ˆ๊นŒ return ๋ฌธ์„ ์‚ผํ•ญ์—ฐ์‚ฐ์ž๋กœ ์•ˆ์จ๋„ ๊ดœ์ฐฎ์ง€์•Š์„๊นŒ์šฉ? ์ œ๊ฐ€ ์ž˜๋ชป ์•Œ๊ณ  ์žˆ๋Š” ๊ฒƒ์ผ ์ˆ˜๋„ ์žˆ์–ด์„œ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON.parse์˜ ์˜ค๋ฅ˜๋ฅผ ์žก์œผ๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ ์ƒ๊ฐํ•ด๋ณด๋‹ˆ ๊ตฌ์กฐ๊ฐ€ ์ข€ ์ž˜๋ชป๋๋„ค์š”.. ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

์—ฌ๋‹ด์œผ๋กœ ์‚ผํ•ญ์—ฐ์‚ฐ์ž๋Š” ์Šคํ† ๋ฆฌ์ง€์— ๋นˆ๋ฌธ์ž์—ด์ด ์ €์žฅ๋˜์–ด ์žˆ์„๋•Œ ์œ ํšจํ•˜๊ฒ ๋„ค์š”!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„์•„ loacalStorage์— ํ‚ค๊ฐ’์ด ์—†์œผ๋ฉด null์ด ๋ฐ˜ํ™˜๋˜๋„ค์š”...! ์ €๋„ ์ž˜๋ชป์•Œ๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹คใ…‹ใ…‹

@hyesung99 hyesung99 dismissed stale reviews from SongInjae and colorkite10 via 190d87d October 25, 2023 07:43
Copy link
Collaborator

@SongInjae SongInjae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค:)

@hyesung99 hyesung99 merged commit 0edaa9c into main Oct 25, 2023
2 checks passed
SongInjae pushed a commit that referenced this pull request Oct 26, 2023
* feat : ์Šคํ† ๋ฆฌ์ง€ ํ‚ค ์ƒ์ˆ˜ ์ €์žฅ

* feat : ๋กœ์ปฌ์Šคํ† ๋ฆฌ์ง€ ๊ด€๋ จ ํ•จ์ˆ˜ ์ถ”๊ฐ€

* fix : localStorage ์—๋Ÿฌ ์ƒํ™ฉ ๋ณ€๊ฒฝ
colorkite10 added a commit that referenced this pull request Oct 27, 2023
* design: layout ui ์ ์šฉ

* fix: Layout Content margin

* SKRF-146 local storage ๊ธฐ๋Šฅ ์ถ”๊ฐ€ (#21)

* feat : ์Šคํ† ๋ฆฌ์ง€ ํ‚ค ์ƒ์ˆ˜ ์ €์žฅ

* feat : ๋กœ์ปฌ์Šคํ† ๋ฆฌ์ง€ ๊ด€๋ จ ํ•จ์ˆ˜ ์ถ”๊ฐ€

* fix : localStorage ์—๋Ÿฌ ์ƒํ™ฉ ๋ณ€๊ฒฝ

* msw ์ดˆ๊ธฐ์„ค์ • & ์ดˆ๊ธฐ์„ค์ • ํŽ˜์ด์ง€ api ๊ตฌํ˜„ (#23)

* chore: msw ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜

* feat: ์ดˆ๊ธฐ์„ค์ • ํŽ˜์ด์ง€ API ๊ตฌํ˜„

* style: api res๊ฐ์ฒด ํ†ต์ผ

* fix: msw ์„œ๋ฒ„ ๋ฌธ์ œ ์ž ์‹œ ํ•ด๊ฒฐ

* fix: ์ฝ”๋“œ๋ฆฌ๋ทฐ ๋ฐ˜์˜

* SKRF-139 design banner component (#25)

* design: ๋ฐฐ๋„ˆ ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„

* design: ๋ฐฐ๋„ˆ ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„

* rename: import ํŒŒ์ผ ์ด๋ฆ„ ๋ณ€๊ฒฝ

* SKRF-142 design: ํ—ค๋” ๋ ˆ์ด์•„์›ƒ ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„ (#20)

* design: ํ—ค๋” ๋ ˆ์ด์•„์›ƒ ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„

* design: ํ—ค๋” ๋ ˆ์ด์•„์›ƒ ์„ค์ • ๋ฐ children์ปจํ…Œ์ด๋„ˆ ์ˆ˜์ •

* ์ฝ”๋“œ ์ถฉ๋Œ1

* fix: ์ฝ”๋“œ๋ฆฌ๋ทฐ ๋ฐ˜์˜1

* fix: ์ฝ”๋“œ๋ฆฌ๋ทฐ ๋ฐ˜์˜

* fix: App.tsx react-queryclient ์‚ญ์ œ

---------

Co-authored-by: hyesung99 <[email protected]>
Co-authored-by: chaeyeon LEE <[email protected]>
@hyesung99 hyesung99 deleted the SKRF-146-localStorage branch October 28, 2023 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants