cushax-client
Advanced tools
Comparing version 0.1.11 to 0.1.13
@@ -8,2 +8,3 @@ /// <reference types="socket.io-client" /> | ||
private vue; | ||
private _retryTimes; | ||
get state(): TModule["state"]; | ||
@@ -13,3 +14,4 @@ constructor(socket: SocketIOClient.Socket, vue: Vue); | ||
auth: CushaxAuthType<TModule>; | ||
private retry; | ||
} | ||
export {}; |
@@ -6,2 +6,3 @@ var Cushax = /** @class */ (function () { | ||
this.vue = vue; | ||
this._retryTimes = 0; | ||
this.commit = (function (name, payload) { | ||
@@ -12,5 +13,8 @@ _this.vue.$store.commit("cushax/" + name, payload); | ||
if (!_this.socket.connected) { | ||
if (!_this.retry()) { | ||
return; | ||
} | ||
setTimeout(function () { | ||
_this.auth(data); | ||
}); | ||
}, 100); | ||
return; | ||
@@ -28,4 +32,12 @@ } | ||
}); | ||
Cushax.prototype.retry = function () { | ||
if (this._retryTimes === 5) { | ||
this._retryTimes = 0; | ||
return false; | ||
} | ||
this._retryTimes++; | ||
return true; | ||
}; | ||
return Cushax; | ||
}()); | ||
export { Cushax }; |
{ | ||
"name": "cushax-client", | ||
"version": "0.1.11", | ||
"version": "0.1.13", | ||
"author": "boenfu <1997@boenfu.cn>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
16999
381