khedron73-vue-realtime

0.1.1 • Public • Published

Vue-Realtime

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)

Package Sidebar

Install

npm i khedron73-vue-realtime

Weekly Downloads

0

Version

0.1.1

License

ISC

Unpacked Size

3.65 kB

Total Files

3

Last publish

Collaborators

  • khedron73