-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: Leeseunghwan7305
Are you sure you want to change the base?
[feat] 채팅방 기능 백엔드없이 구현 #14
Conversation
docs: 깃허브 이슈 템플릿 등록
…5/front_mini_project into Leeseunghwan7305
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.
고생하셨습니다!
@@ -8,6 +8,7 @@ import { routes } from '@/Routes'; | |||
export default function App() { | |||
const queryClient = getClient(); | |||
const elem = useRoutes(routes); | |||
console.log('test'); |
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.
콘솔로그 코드는 제거하는게 좋을 것 같아요!
const connect = () => { | ||
client.current = new StompJS.Client({ | ||
brokerURL: 'baseUrl 주소', | ||
connectHeaders: { | ||
//유저객체가 들어갈듯 | ||
}, | ||
debug: function (str) { | ||
console.log(str); | ||
}, | ||
onConnect: () => { | ||
handleSub(); //client가 연결을 시도한다면 채팅방으로도 연결을 해준다. | ||
}, | ||
}); | ||
|
||
client.current?.activate(); // 연결시도 시켜주는 함수 | ||
}; |
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.
connect와 disconnect는 다른 컴포넌트에서도 사용할 가능성이 있을 것 같아서 로직을 따로 빼도 괜찮을 것 같아요!
const disConnect = () => { | ||
if (client.current?.connected) client.current.deactivate(); | ||
}; |
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.
위 connect 코멘트랑 동일한 내용입니다 :)
추가한 기능 설명
채팅로직 구현
check list