# fix
- authentication
- profile
- pencarian user
- forum
## No issue
This commit is contained in:
2024-05-20 10:55:13 +08:00
parent 66b9902d97
commit dbeb740d1f
58 changed files with 1374 additions and 386 deletions

3
src/util/evn.ts Normal file
View File

@@ -0,0 +1,3 @@
import { EventEmitter } from "events";
export const evnPesan = new EventEmitter();

View File

@@ -4,17 +4,22 @@ import { useEffect, useState } from "react";
import mqtt_client from "./mqtt_client";
import { useAtom } from "jotai";
import { gs_coba_chat } from "@/app/makuro/gs_coba";
import { evnPesan } from "./evn";
export default function MqttLoader() {
useEffect(() => {
mqtt_client.on("connect", () => {
console.log("connected");
// mqtt_client.subscribe("server12");
mqtt_client.subscribe("pesan");
// fetch("").then((res) => {
// mqtt_client.subscribe("pesan");
// });
});
// mqtt_client.on("message", (apa) => {
// console.log("Ini yang di utils");
// });
mqtt_client.on("message", (apa: any, itu: any) => {
console.log(itu)
evnPesan.emit("pesan", itu);
});
}, []);
return null;
}