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

[신승준] 챕터 7: 자바스크립트 디자인 패턴 (3/3) #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

metacode22
Copy link
Contributor

허허.. 이해는 잘 안되네요. 어렵구만유

Copy link
Contributor

@sangbooom sangbooom left a comment

Choose a reason for hiding this comment

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

👍🏻👍🏻👍🏻

Comment on lines +295 to +305
```typescript
const queryClient = new QueryClient({
queryCache: new QueryCache({
onError: (error) => {
...
},
}),
});
```

> 요런 친구도 중재자 패턴이라고 할 수 있을까요? 하위 ErrorBoundary에서 걸러지지 않은 에러들은 이렇게 최상위의 query client에서 처리해주고 있는디.
Copy link
Contributor

@sangbooom sangbooom Nov 12, 2024

Choose a reason for hiding this comment

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

제 생각엔 퍼사드 패턴 같아요!
QueryClient가 퍼사드 역할을 하고 내부적으로는 QueryCache와 다른 요소들이 함께 작동한다는 점이 퍼사드 패턴이지 않을까 생각이 드네요 🤔

Copy link
Member

Choose a reason for hiding this comment

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

둘 다 아닐까요?

QueryClient라는 중재자를 두어 에러처리를 중앙에서 처리하니까 개별 컴포넌트간의 의존성과 결합도를 낮출 수 있는거고, onError같은 핸들러는 복잡한 구현을 숨기고 사용성이 좋은 인터페이스만 노출하니까 퍼사드라고 볼 수 있을 것 같아요

Copy link
Member

Choose a reason for hiding this comment

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

두분 다 쩌시네요

저는 그냥 코드 더미로만 보이는데

Copy link
Member

@hyesungoh hyesungoh left a comment

Choose a reason for hiding this comment

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

👍 👍 👍 👍

Comment on lines +266 to +268

> [디자인패턴, Flyweight Pattern, 플라이 웨이트 패턴](https://www.youtube.com/watch?v=oRThakO5o-Q) 이 영상의 예시가 조금 더 쉬워서 이해하기 수월했어요.

Copy link
Member

Choose a reason for hiding this comment

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

🐷 🐷 🐷

Comment on lines +295 to +305
```typescript
const queryClient = new QueryClient({
queryCache: new QueryCache({
onError: (error) => {
...
},
}),
});
```

> 요런 친구도 중재자 패턴이라고 할 수 있을까요? 하위 ErrorBoundary에서 걸러지지 않은 에러들은 이렇게 최상위의 query client에서 처리해주고 있는디.
Copy link
Member

Choose a reason for hiding this comment

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

두분 다 쩌시네요

저는 그냥 코드 더미로만 보이는데

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

Successfully merging this pull request may close these issues.

4 participants