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

[view] 상태 관리 도구 도입을 위한 overview #673

Closed
Sang-minKIM opened this issue Aug 26, 2024 · 0 comments
Closed

[view] 상태 관리 도구 도입을 위한 overview #673

Sang-minKIM opened this issue Aug 26, 2024 · 0 comments
Assignees
Milestone

Comments

@Sang-minKIM
Copy link
Contributor

개요

상태 관리 도구로 zustand를 도입하기 위해 현재 githru의 전역 상태를 구독하고 있는 component, hook을 트리 구조로 나타내었습니다.
hook은 트리로 나타내는게 적합하진 않지만 파일명과 폴더구조 상 트리에 포함하였습니다.
편의상 setState 함수나 setState 함수를 이용해 여러 상태를 변경시키는 함수는 포함시키지 않았습니다.

component - 파란색
hook - 빨간색
전역 상태 - 노란색

image

GlobalDataProvider

GlobalDataProvider는 7개의 전역 상태를 생성하고 자식 컴포넌트에서 사용할 수 있도록 하고 있습니다.

image

전역 상태를 구독하고 있는 components & hooks

image
image

앞으로의 계획

zustand를 점진적으로 도입하면서 contextAPI로 사용하고 있는 전역 상태를 store로 옮기고, setState를 사용한 함수들은 action함수로 만들 예정입니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants