Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
], (require) => {
// Socketcluster and rpc layer.
var SC = require("socketcluster-client/index");
var SCRPC = require("avs-rpc").scRpc;
// Connect
console.log(this)
this.scConn = SC.connect();
this.rpc = new SCRPC(this.scConn);
// Connect the basic events.
this.scConn.on('error', (err) => {
console.log("Error:", err);
});
this.scConn.on('connect', () => {
// Logging
this.scConn.on("client_log", (msg) => {
console.log("REMOTE>", msg);
});
// RPC
this.scConn.on("rpc_init_data", (methods) => {
//console.log("Methods:",methods);
this.rpcr = this.rpc.remote.call(this.rpc, methods);