feat: Introduce TinyMqttClient interface and implementation, update auth store for MQTT connection management
This commit is contained in:
4
src/lib/interface.ts
Normal file
4
src/lib/interface.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface ITinyMqttClient {
|
||||
connect(): void;
|
||||
disconnect(): void;
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { ITinyMqttClient } from "./interface";
|
||||
|
||||
export type MessageCallback = (topic: string, payload: string) => void;
|
||||
export class TinyMqttClient {
|
||||
export class TinyMqttClient implements ITinyMqttClient {
|
||||
private ws: WebSocket | null = null;
|
||||
private encoder = new TextEncoder();
|
||||
private decoder = new TextDecoder();
|
||||
|
||||
Reference in New Issue
Block a user