fix: mqtt
Deskripsi: - hapus package mqtt No Issues
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import mtqq from 'mqtt'
|
||||
|
||||
declare global {
|
||||
var mtqq_client: mtqq.MqttClient
|
||||
}
|
||||
|
||||
const mtqq_client = globalThis.mtqq_client ?? mtqq.connect("wss://io.wibudev.com")
|
||||
|
||||
export default mtqq_client
|
||||
@@ -1,18 +0,0 @@
|
||||
'use client'
|
||||
import { useEffect } from "react"
|
||||
import mtqq_client from "./mqtt_client"
|
||||
|
||||
export default function MqttLoad() {
|
||||
useEffect(() => {
|
||||
mtqq_client.on("connect", () => {
|
||||
mtqq_client.subscribe("app_SDM")
|
||||
})
|
||||
|
||||
mtqq_client.on("message", (topic, message) => {
|
||||
const data = JSON.parse(message.toString())
|
||||
})
|
||||
}, [])
|
||||
return <>
|
||||
|
||||
</>
|
||||
}
|
||||
Reference in New Issue
Block a user