exaquark-js
Advanced tools
Comparing version 1.0.13 to 1.0.14
41
core.js
@@ -15,2 +15,4 @@ 'use strict'; | ||
var axios = require('axios'); | ||
// const loadJSONP = (() => { | ||
@@ -49,2 +51,3 @@ // let unique = 0 | ||
*/ | ||
var exaQuark = function () { | ||
@@ -94,30 +97,32 @@ function exaQuark(allocatorUrl, apiKey) { | ||
return new Promise(function (resolve, reject) { | ||
(0, _private.getRequest)(_this.allocatorUrl, function (err, response) { | ||
console.log('err', err); | ||
console.log('response', response); | ||
_this.entryPoint = response.entryPoint; | ||
_this.iid = response.iid; | ||
var self = _this; | ||
axios.get(_this.allocatorUrl).then(function (res) { | ||
var response = res.data; | ||
self.entryPoint = response.entryPoint; | ||
self.iid = response.iid; | ||
var initialState = _this.deepClone(payload); | ||
initialState.iid = _this.iid; | ||
_this.state = initialState; | ||
var initialState = self.deepClone(payload); | ||
initialState.iid = self.iid; | ||
self.state = initialState; | ||
var encodedState = encodeURIComponent(JSON.stringify(initialState)); | ||
_this.conn = new WebSocket(_this.entryPoint + '?state=' + encodedState); // eslint-disable-line | ||
_this.conn.onopen = function (data) { | ||
return _this.onConnOpen(data); | ||
self.conn = new WebSocket(self.entryPoint + '?state=' + encodedState); // eslint-disable-line | ||
self.conn.onopen = function (data) { | ||
return self.onConnOpen(data); | ||
}; | ||
_this.conn.onerror = function (error) { | ||
return _this.onConnError(error); | ||
self.conn.onerror = function (error) { | ||
return self.onConnError(error); | ||
}; | ||
_this.conn.onmessage = function (event) { | ||
return _this.onConnMessage(event); | ||
self.conn.onmessage = function (event) { | ||
return self.onConnMessage(event); | ||
}; | ||
_this.conn.onclose = function (event) { | ||
return _this.onConnClose(event); | ||
self.conn.onclose = function (event) { | ||
return self.onConnClose(event); | ||
}; | ||
return resolve({ | ||
iid: _this.iid | ||
iid: self.iid | ||
}); | ||
}).catch(function (error) { | ||
reject(error); | ||
}); | ||
@@ -124,0 +129,0 @@ }); |
{ | ||
"name": "exaquark-js", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "JS wrapper for exaquark.com", | ||
@@ -65,4 +65,5 @@ "main": "./", | ||
"dependencies": { | ||
"axios": "^0.18.0", | ||
"xhr": "^2.4.1" | ||
} | ||
} |
@@ -37,2 +37,10 @@ # exaQuark JS | ||
##### 1.0.14 | ||
- Migrating to axios for better ReactNative support | ||
##### 1.0.13 | ||
- Updateing index.js to core.js for main functionality | ||
##### 1.0.11 | ||
@@ -39,0 +47,0 @@ |
@@ -1,4 +0,3 @@ | ||
'use strict'; | ||
"use strict"; | ||
var xhr = require('xhr'); | ||
var _exports = module.exports = {}; | ||
@@ -9,8 +8,2 @@ | ||
logger(msg, data); | ||
}; | ||
_exports.getRequest = function (url, callback) { | ||
xhr.get(url, function (err, resp) { | ||
callback(err, JSON.parse(resp.body)); | ||
}); | ||
}; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16523
69
0
2
386
+ Addedaxios@^0.18.0
+ Addedaxios@0.18.1(transitive)
+ Addedfollow-redirects@1.5.10(transitive)
+ Addedis-buffer@2.0.5(transitive)