Skip to content
Snippets Groups Projects
Commit 9423d53f authored by Minseo Lee's avatar Minseo Lee
Browse files

feat: socket on `order`

parent 29234704
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ import S from './App.module.css';
import APP_ROUTE from "./config/route";
import Wrapper from "./modules/wrapper/Wrapper";
import type { CartItemPostModel } from "../pages/cart-page/config/type";
import type { MutableRefObject } from 'react';
......@@ -48,6 +49,13 @@ function App() {
socket.current = new Socket();
console.log(socket.current);
socket.current?.onOrder((d: CartItemPostModel) => {
console.log(d);
setToastItem({
id: '', title: d.shopId, description: d.waitingCount.toString(), goto: ''
});
});
return () => socket.current?.disconnect();
}, [login]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment