-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
The head ref may contain hidden characters: "\uCC55\uD1307_3/\uC2E0\uC2B9\uC900"
Conversation
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.
👍🏻👍🏻👍🏻
```typescript | ||
const queryClient = new QueryClient({ | ||
queryCache: new QueryCache({ | ||
onError: (error) => { | ||
... | ||
}, | ||
}), | ||
}); | ||
``` | ||
|
||
> 요런 친구도 중재자 패턴이라고 할 수 있을까요? 하위 ErrorBoundary에서 걸러지지 않은 에러들은 이렇게 최상위의 query client에서 처리해주고 있는디. |
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.
제 생각엔 퍼사드 패턴 같아요!
QueryClient가 퍼사드 역할을 하고 내부적으로는 QueryCache와 다른 요소들이 함께 작동한다는 점이 퍼사드 패턴이지 않을까 생각이 드네요 🤔
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.
둘 다 아닐까요?
QueryClient라는 중재자를 두어 에러처리를 중앙에서 처리하니까 개별 컴포넌트간의 의존성과 결합도를 낮출 수 있는거고, onError같은 핸들러는 복잡한 구현을 숨기고 사용성이 좋은 인터페이스만 노출하니까 퍼사드라고 볼 수 있을 것 같아요
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.
두분 다 쩌시네요
저는 그냥 코드 더미로만 보이는데
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.
👍 👍 👍 👍
|
||
> [디자인패턴, Flyweight Pattern, 플라이 웨이트 패턴](https://www.youtube.com/watch?v=oRThakO5o-Q) 이 영상의 예시가 조금 더 쉬워서 이해하기 수월했어요. | ||
|
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.
🐷 🐷 🐷
```typescript | ||
const queryClient = new QueryClient({ | ||
queryCache: new QueryCache({ | ||
onError: (error) => { | ||
... | ||
}, | ||
}), | ||
}); | ||
``` | ||
|
||
> 요런 친구도 중재자 패턴이라고 할 수 있을까요? 하위 ErrorBoundary에서 걸러지지 않은 에러들은 이렇게 최상위의 query client에서 처리해주고 있는디. |
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.
두분 다 쩌시네요
저는 그냥 코드 더미로만 보이는데
허허.. 이해는 잘 안되네요. 어렵구만유