4주차 리뷰 #27
Replies: 4 comments
-
[생각]
[요약] [8장] 사용 사례 시나리오 2: Jotai
Atom
Jotai가 아톰 값을 저장하는 방식 이해하기
배열 구조 추가하기: Atoms-in-Atom
[9장] 사용 사례 시나리오 3: Valtio
Proxy를 활용한 변경 감지 및 불변 상태 생성하기
Proxy를 활용한 리렌더링 최적화
이러한 접근방식의 장단점
변경 가능한 갱신의 장단점
|
Beta Was this translation helpful? Give feedback.
-
Atoms-in-Atom type Todo = {
title: string;
done: boolean;
};
type TodoAtom = PrimitiveAtom<Todo>;
const todoAtomsAtom = atom<TodoAtom[]>([]); 무슨 장점이 있을까?
의존성 추적 (get) => get(a) ? get(b) : get(c) →
|
Beta Was this translation helpful? Give feedback.
-
Jotai가 리렌더링을 방지하기 위해 작은 단위의 원자 Atom으로 나눠 관리한다는 것을 파악했다. Bottom-Up 방식에 대해 이해할 수 있었다. Zustand와 Jotai 중에 무엇을 쓸지 고민했을 때 Jotai는 Recoil과 유사한 방식이고 Atom이 많아지면 코드가 많아지는게 아쉬워서 용량이 작은 Zustand를 선택했었는데 리렌더링 최적화부분에선 Jotai가 나쁘지 않은 것 같다. 배열 구조를 다룰 때 쓰는 Atoms-in-Atom 패턴은 상태 관리 뿐만 아니라 단일 요소를 바꾸기 위해 배열 전체를 갱신하는 경우에 활용해봐도 좋을 것 같다. |
Beta Was this translation helpful? Give feedback.
-
Jotai
Valito
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
한 줄 요약, 주요 내용 정리, 인상 깊은 구절, 종합 평가 등 다양하게 작성
Beta Was this translation helpful? Give feedback.
All reactions