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

[박상범] 5장: 구부러지거나 부러지거나 #52

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Conversation

sangbooom
Copy link
Collaborator

No description provided.

Copy link
Member

@100Gyeon 100Gyeon 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 +71 to +72
> ![image](https://github.com/user-attachments/assets/85b1be9c-b98d-4a90-a8d1-b497d63eee89)
> react-query 코어 내부 동작은 observer 인가 pub/sub 패턴 인가.. 둘 다 섞은 패턴일까?
Copy link
Member

Choose a reason for hiding this comment

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

저도 궁금해서 발표 끝나고 좀 더 찾아봤습니다..!

image

Observer와 다르게 Pub-Sub은 채널의 도움을 받는데
이 채널의 역할을 notifyManager가 해주고 있는 것 같아요
https://github.com/TanStack/query/blob/683c85e02c58c988cb520958941fcd163bd00eee/packages/query-core/src/queriesObserver.ts#L271

그래서 저는 Pub-Sub이라고 생각했습니다🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

어제 제 의견을 먼저 말씀드렸어야됐는데 못 드렸네요 😅 저도 지연님 의견과 동일한 이유로 pub-sub 이라고 생각했어요!
근데 'react-query 옵저버 패턴'이라고 하면 옵저버 패턴이라고 단언하는 블로그 글들이 나와서.. 제 생각과 다르더라구요 🤔

Copy link
Member

Choose a reason for hiding this comment

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

보법이 다르시군요 또 배워갑니다 👍 👍 :godmode:

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.

👍 👍 👍 👍

@sangbooom sangbooom merged commit 7f73023 into main Aug 28, 2024
1 check passed
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.

3 participants