airfone-client-js
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -29,3 +29,5 @@ export declare type StatusEvent = 'connect' | 'disconnect' | 'online' | 'offline' | 'error'; | ||
private state; | ||
private socketOptions; | ||
constructor(options: ClientOptions); | ||
setup(options: any): this; | ||
connect(): this; | ||
@@ -32,0 +34,0 @@ disconnect(): void; |
@@ -30,15 +30,13 @@ import { io } from 'socket.io-client'; | ||
this.state = 0; | ||
this.socketOptions = {}; | ||
this.options = options; | ||
} | ||
setup(options) { | ||
Object.assign(this.socketOptions, options); | ||
return this; | ||
} | ||
connect() { | ||
let { id, room, role, server, token } = this.options; | ||
this.state = 1; | ||
this.socket = io(`${win.AF_SERVER || server || '/'}`, { | ||
query: { id, room, role }, | ||
transports: ['websocket'], | ||
auth: { token }, | ||
secure: true, | ||
reconnectionDelayMax: 30000, | ||
reconnectionAttempts: 50 | ||
}).compress(true).on('connect', () => { | ||
this.socket = io(`${win.AF_SERVER || server || '/'}`, Object.assign(Object.assign({}, this.socketOptions), { query: { id, room, role }, transports: ['websocket'], auth: { token }, secure: true, reconnectionDelayMax: 30000, reconnectionAttempts: 50 })).compress(true).on('connect', () => { | ||
var _a; | ||
@@ -45,0 +43,0 @@ this.state = 2; |
{ | ||
"name": "airfone-client-js", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9797
229