MQTT over Websocket implementation for vue
Install:
npm i khedron73-vue-realtime --save
import VueRealtime from "khedron73-vue-realtime";
Vue.use(VueRealtime,options**)
Usage:
/**
* Connect to Broker
* @param host :String!
* @param port :Int!
* @param user :String!
* @param pass :String!
*/
this.$realtime.connect(host,port,user,pass)
/**
* Subscribe to a topic and execute the declared function
* Topis can have multiple assigned functions
* @param topic : String!
* @param fnc : Function!
*/
this.$realtime.subscribe(topic,fnc)
/**
* Unsubscribe from a topic.
* Every attached function gets removed as well
* @param topic : String!
*/
this.$realtime.unsubscribe(topic)