-
Notifications
You must be signed in to change notification settings - Fork 10
[adv-2.2단계(zustand)] 박찬빈 미션 제출합니다. #37
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
base: INSANE-P
Are you sure you want to change the base?
Changes from 26 commits
8ec1008
ed1ebc8
b8ed211
fa5fa6d
e502aee
342ed3b
36e5a31
5e00a3c
d8222c2
466fbb4
d895e69
fd7f46a
a49804a
08183c0
79a074b
7fee236
1a6e02b
4ba62ed
5231c7d
d72b0c3
20e2d9f
2e3b09a
b4ca1b8
4d13c17
2253d7f
f4146ea
8446b52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # 02-2. 전역상태관리 - Zustand | ||
|
|
||
| ## 🎯 요구사항 | ||
|
|
||
| - Context API로 구성한 애플리케이션을 Zustand 기반 전역 상태로 마이그레이션하세요. | ||
| - (선택): 카테고리 필터의 선택된 카테고리가 새로고침 후에도 유지되도록 구현해보세요. | ||
| - props에 대한 요구사항은 2-1 요구사항과 같습니다. | ||
| - Zustand를 **왜** 사용하는지, Context API와 비교했을때 어떤 점이 달랐는지, 또 trade-off가 있는지 적어주세요. | ||
| - 기술적인 것도 좋고 개발자의 경험 측면에서도 좋습니다. | ||
|
|
||
| ### 😗구현 예시 | ||
|
|
||
| - 컴포넌트의 이름이나 구조는 마음대로 변경해도 좋습니다. | ||
| - 아래 코드는 Zustand 스토어를 설정하는 예시입니다. | ||
|
|
||
| ```javascript | ||
| import { create } from 'zustand'; | ||
|
|
||
| // Zustand 스토어 예시 | ||
| export const useBear = create((set) => ({ | ||
| // state | ||
| bears: 0, | ||
|
|
||
| // actions | ||
| increasePopulation: () => set((state) => ({ bears: state.bears + 1 })), | ||
| removeAllBears: () => set({ bears: 0 }), | ||
| updateBears: (newBears) => set({ bears: newBears }), | ||
| })); | ||
| ``` | ||
|
|
||
| ## ✅ 키워드 | ||
|
|
||
| - props drilling | ||
| - 전역상태관리 | ||
| - Zustand | ||
| - create | ||
| - selector pattern | ||
| - set / get | ||
| - slice pattern | ||
| - middleware (persist, createJSONStorage) | ||
|
||
|
|
||
| ## 🧙♀️ 진행 가이드 | ||
|
|
||
| - 진행시간 : 1시간 내에 완료하는 것을 목표로 합니다. | ||
|
|
||
| ## 🔗 참고 문서 | ||
|
|
||
| - [Zustand 공식문서](https://recoiljs.org/docs/introduction/installation/) | ||
| - [Middleware: persist 관련 문서](https://zustand.docs.pmnd.rs/integrations/persisting-store-data) | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,30 @@ | ||
| # 🛣️Let's Go Further Together... | ||
|
|
||
| ###### **이 Repository는 cho-log : self-paced-react step5까지 마치고 난 후 더 나아가 고도화하기 위해 존재합니다.** | ||
|
|
||
| ###### **미션 README 문서는 Let's go further디렉토리에 존재합니다.** | ||
|
|
||
| > 🍀Cho-log-study : self-paced-react, React 기초 | ||
| > | ||
| > https://github.com/cho-log/self-paced-react | ||
| # Why❓ | ||
|
|
||
| 아래의 새로운 기술을 쓸 때는 | ||
|
|
||
| 1. 왜 이 기술을 쓰는지? <br/> | ||
| 2. 기존의 것과 어떤 장단점이 있는지? <br/> | ||
| 3. 썼을때 어떤 일이 일어났는지? <br/> | ||
| 등의 **"왜?"** 라는 질문에 답할 수 있어야합니다.<br/> | ||
| 2. 기존의 것과 어떤 장단점이 있는지? <br/> | ||
| 3. 썼을때 어떤 일이 일어났는지? <br/> | ||
| 등의 **"왜?"** 라는 질문에 답할 수 있어야합니다.<br/> | ||
|
|
||
| 고도화 작업을 할때 항상 **"왜?"** 라는 질문에 답하며 **Deep Dive**합시다. | ||
|
|
||
| # 📈Something To Learn More About | ||
|
|
||
| ### 1. styled-component 적용 | ||
|
|
||
| ### 2. 전역상태관리 툴 다루기 | ||
|
|
||
| 1. #### Context API | ||
| 2. #### Recoil | ||
| 2. #### Zustand | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
| 3. #### Redux | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 제가 문서를 만들 때 처음 썼던 문구인 거 같은데 "마음대로 변경해도 좋다" 라는게 마치 막지어도 된다는 느낌을 줄 수 있지도 않을까?라는 걱정이 드네요😢
위의 제안처럼 하는 것이 어떤지 검토해주시면 감사하겠읍니다 😄 02-state-management에 모든 md파일에 적용해주시면 더 좋을 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 것 같습니다. 수정하겠습니다.🪄