Message Types
Subscribe Type
interface ISubscribe {
type: "subscribe"
data: {
topics: string | string[]
}
}
Unsubscribe Type
interface IUnsubscribe {
type: "unsubscribe"
data: {
topics: string | string[]
}
}
Payload Type
enum MessageTypeEnum {
Error = 'error',
Success = 'success'
}
interface IPayload {
topic?: string
type: string
status: MessageTypeEnum
data: any
}