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

[feat] 채팅방 기능 백엔드없이 구현 #14

Open
wants to merge 6 commits into
base: Leeseunghwan7305
Choose a base branch
from

Conversation

Leeseunghwan7305
Copy link
Member

추가한 기능 설명

채팅로직 구현

check list

  • issue number를 브랜치 앞에 추가 하였는가?
  • 모든 단위 테스트를 돌려보고 기존에 작동하던 테스트에 영향이 없는 것을 확인했는가?
  • 우테코 pr 규칙을 준수하였는가?

Copy link
Member

@sangminlee98 sangminlee98 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@@ -8,6 +8,7 @@ import { routes } from '@/Routes';
export default function App() {
const queryClient = getClient();
const elem = useRoutes(routes);
console.log('test');
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 +70 to +85
const connect = () => {
client.current = new StompJS.Client({
brokerURL: 'baseUrl 주소',
connectHeaders: {
//유저객체가 들어갈듯
},
debug: function (str) {
console.log(str);
},
onConnect: () => {
handleSub(); //client가 연결을 시도한다면 채팅방으로도 연결을 해준다.
},
});

client.current?.activate(); // 연결시도 시켜주는 함수
};
Copy link
Member

Choose a reason for hiding this comment

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

connect와 disconnect는 다른 컴포넌트에서도 사용할 가능성이 있을 것 같아서 로직을 따로 빼도 괜찮을 것 같아요!

Comment on lines +117 to +119
const disConnect = () => {
if (client.current?.connected) client.current.deactivate();
};
Copy link
Member

Choose a reason for hiding this comment

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

위 connect 코멘트랑 동일한 내용입니다 :)

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

Successfully merging this pull request may close these issues.

2 participants