Comparing version 2.10.11 to 2.10.12
@@ -20,3 +20,5 @@ var __values = this && this.__values || function (o) { | ||
var EventEmitter = function () { | ||
var EventEmitter = | ||
/** @class */ | ||
function () { | ||
function EventEmitter() { | ||
@@ -23,0 +25,0 @@ var _this = this; |
@@ -58,2 +58,3 @@ var __read = this && this.__read || function (o, n) { | ||
var websocketRef = useRef(); | ||
var unmountedRef = useRef(false); | ||
@@ -117,2 +118,6 @@ var _d = __read(useState(), 2), | ||
if (unmountedRef.current) { | ||
return; | ||
} | ||
reconnect(); | ||
@@ -166,2 +171,3 @@ onClose && onClose(event); | ||
useUnmount(function () { | ||
unmountedRef.current = true; | ||
disconnect(); | ||
@@ -168,0 +174,0 @@ }); |
@@ -27,3 +27,5 @@ "use strict"; | ||
var EventEmitter = function () { | ||
var EventEmitter = | ||
/** @class */ | ||
function () { | ||
function EventEmitter() { | ||
@@ -30,0 +32,0 @@ var _this = this; |
@@ -74,2 +74,3 @@ "use strict"; | ||
var websocketRef = react_1.useRef(); | ||
var unmountedRef = react_1.useRef(false); | ||
@@ -133,2 +134,6 @@ var _d = __read(react_1.useState(), 2), | ||
if (unmountedRef.current) { | ||
return; | ||
} | ||
reconnect(); | ||
@@ -182,2 +187,3 @@ onClose && onClose(event); | ||
useUnmount_1["default"](function () { | ||
unmountedRef.current = true; | ||
disconnect(); | ||
@@ -184,0 +190,0 @@ }); |
{ | ||
"name": "ahooks", | ||
"version": "2.10.11", | ||
"version": "2.10.12", | ||
"description": "react hooks library", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@ahooksjs/use-request": "^2.8.12", | ||
"@ahooksjs/use-request": "^2.8.13", | ||
"@types/js-cookie": "^2.2.6", | ||
@@ -64,3 +64,3 @@ "dayjs": "^1.9.1", | ||
"license": "MIT", | ||
"gitHead": "561ebf0c820fa5fd6f1a8e83d6a8de3474254921" | ||
"gitHead": "9285107e858e38d6042c76b7a9780ac5040cf657" | ||
} |
Sorry, the diff of this file is too big to display
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
424231
284
10285